diff --git a/app/api/common-api/src/main/java/org/example/vo/UserRoleApiType.java b/app/api/common-api/src/main/java/org/example/vo/UserRoleApiType.java index 05e24e6e..2c214fbe 100644 --- a/app/api/common-api/src/main/java/org/example/vo/UserRoleApiType.java +++ b/app/api/common-api/src/main/java/org/example/vo/UserRoleApiType.java @@ -1,7 +1,6 @@ package org.example.vo; import lombok.Getter; -import org.example.entity.User; @Getter public enum UserRoleApiType { @@ -15,7 +14,7 @@ public enum UserRoleApiType { this.authority = authority; } - public static UserRoleApiType from(User user) { - return UserRoleApiType.valueOf(user.getUserRole().name()); + public static UserRoleApiType from(UserRole userRole) { + return UserRoleApiType.valueOf(userRole.name()); } } diff --git a/app/api/user-api/src/main/java/org/example/service/UserService.java b/app/api/user-api/src/main/java/org/example/service/UserService.java index fa8663ca..024ded50 100644 --- a/app/api/user-api/src/main/java/org/example/service/UserService.java +++ b/app/api/user-api/src/main/java/org/example/service/UserService.java @@ -23,7 +23,7 @@ public TokenParam login(final LoginServiceRequest loginServiceRequest) { User createdUser = userUseCase.save(loginServiceRequest.toUser()); UserParam userParam = UserParam.builder() .userId(createdUser.getId()) - .role(UserRoleApiType.from(createdUser)) + .role(UserRoleApiType.from(createdUser.getUserRole())) .build(); return jwtGenerator.generate(userParam, new Date());