MSP-2175 align func naming
This commit is contained in:
1 parent
c08782855b
commit
e65f5ac03c
8 files changed
+27
-37
No files matched your search
+2
-2
@@ -43,7 +43,7 @@ func NewAuth(authService authService, logger log.Logger) Auth {
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /auth/logout [POST]
|
||||
func (a Auth) Logout(ctx context.Context, authData grpc.AuthData) error {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func (a Auth) LoginWithSudir(ctx context.Context, request domain.LoginSudirReque
|
||||
}
|
||||
}
|
||||
|
||||
func getUserToken(authData grpc.AuthData) (int64, error) {
|
||||
func getAdminId(authData grpc.AuthData) (int64, error) {
|
||||
token, err := grpc.StringFromMd(domain.AdminAuthIdHeader, metadata.MD(authData))
|
||||
if err != nil {
|
||||
return 0, status.Error(codes.InvalidArgument, err.Error())
|
||||
|
||||
+3
-3
@@ -61,7 +61,7 @@ func (u Role) All(ctx context.Context) ([]domain.Role, error) {
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /role/create [POST]
|
||||
func (u Role) CreateRole(ctx context.Context, authData grpc.AuthData, req domain.CreateRoleRequest) (*domain.Role, error) {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -91,7 +91,7 @@ func (u Role) CreateRole(ctx context.Context, authData grpc.AuthData, req domain
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /role/update [POST]
|
||||
func (u Role) UpdateRole(ctx context.Context, authData grpc.AuthData, req domain.UpdateRoleRequest) (*domain.Role, error) {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func (u Role) UpdateRole(ctx context.Context, authData grpc.AuthData, req domain
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /role/delete [POST]
|
||||
func (u Role) DeleteRole(ctx context.Context, authData grpc.AuthData, req domain.DeleteRoleRequest) error {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+5
-5
@@ -43,7 +43,7 @@ func NewUser(userService userService) User {
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /user/get_profile [POST]
|
||||
func (u User) GetProfile(ctx context.Context, authData grpc.AuthData) (*domain.AdminUserShort, error) {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -96,7 +96,7 @@ func (u User) GetUsers(ctx context.Context, identities domain.UsersRequest) (*do
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /user/create_user [POST]
|
||||
func (u User) CreateUser(ctx context.Context, authData grpc.AuthData, req domain.CreateUserRequest) (*domain.User, error) {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func (u User) CreateUser(ctx context.Context, authData grpc.AuthData, req domain
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /user/update_user [POST]
|
||||
func (u User) UpdateUser(ctx context.Context, authData grpc.AuthData, req domain.UpdateUserRequest) (*domain.User, error) {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -160,7 +160,7 @@ func (u User) UpdateUser(ctx context.Context, authData grpc.AuthData, req domain
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /user/delete_user [POST]
|
||||
func (u User) DeleteUser(ctx context.Context, authData grpc.AuthData, identities domain.IdentitiesRequest) (*domain.DeleteResponse, error) {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -185,7 +185,7 @@ func (u User) DeleteUser(ctx context.Context, authData grpc.AuthData, identities
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /user/block_user [POST]
|
||||
func (u User) Block(ctx context.Context, authData grpc.AuthData, identities domain.IdRequest) error {
|
||||
adminId, err := getUserToken(authData)
|
||||
adminId, err := getAdminId(authData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user