Skip to content

Commit

Permalink
refactor : 유저 정보조회 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
imenuuu committed Nov 25, 2023
1 parent 521918a commit 913cffb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UserController(
) {
@GetMapping("")
@ApiErrorCodeExample(UserAuthErrorCode::class)
@Operation(summary = "01-01 내 정보 조회")
@Operation(summary = "01-01 내 정보 조회 홈화면과 마이페이지 용")
fun getUserInfo(@AuthenticationPrincipal user: User) : CommonResponse<UserRes.UserInfoDto>{
return CommonResponse.onSuccess(userService.getUserInfo(user))
}
Expand All @@ -34,11 +34,4 @@ class UserController(
userService.deleteUser(user)
return CommonResponse.onSuccess("탈퇴 성공")
}

@GetMapping("/my-page")
@Operation(summary = "01-03 마이페이지 조회")
@ApiErrorCodeExample(UserAuthErrorCode::class)
fun getMyPage(@AuthenticationPrincipal user: User) : CommonResponse<UserRes.MyPageUserInfoDto>{
return CommonResponse.onSuccess(userService.getMyPage(user))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class UserConvertor {
return UserRes.UserInfoDto(
nickname = user.nickname,
generation = userPart.get().generation,
name = user.name,
email = user.username,
part = userPart.get().part
)
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/example/cmc_be/user/dto/UserRes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import com.example.cmc_be.domain.user.enums.Part

class UserRes {
data class UserInfoDto(
val name : String,
val email : String,
val nickname : String,
val generation : Int,
val part : Part
Expand Down

0 comments on commit 913cffb

Please sign in to comment.