Skip to content

Commit

Permalink
Merge pull request #89 from AdultOfNineteen/refactor/issue-87
Browse files Browse the repository at this point in the history
λ‹‰λ„€μž„ μˆ˜μ • κ΅¬ν˜„
  • Loading branch information
imenuuu authored Feb 1, 2024
2 parents 9e91868 + e7e6ea6 commit 315ce76
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,15 @@ public CommonResponse<UserResponse.UserInfoDTO> getUserInfo(
return CommonResponse.onSuccess(userService.getUserInfo(user));
}

@Operation(summary = "01-12 User πŸ‘€ μœ μ € λ‹‰λ„€μž„ λ³€κ²½ Mage By Austin", description = "μœ μ € λ‹‰λ„€μž„ λ³€κ²½.")
@ApiErrorCodeExample(UserAuthErrorCode.class)
@PatchMapping("/nickname")
public CommonResponse<String> patchNickname(
@AuthenticationPrincipal User user,
@RequestParam String nickname
){
userService.patchNickname(user, nickname);
return CommonResponse.onSuccess("μˆ˜μ • μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ public interface UserService {
void deleteFcmToken(User user, String deviceId);

UserResponse.UserInfoDTO getUserInfo(User user);

void patchNickname(User user, String nickname);
}
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,10 @@ public void deleteFcmToken(User user, String deviceId) {
public UserResponse.UserInfoDTO getUserInfo(User user) {
return UserResponse.UserInfoDTO.builder().userId(user.getId()).status(user.getStatus()).build();
}

@Override
public void patchNickname(User user, String nickname) {
user.setNickName(nickname);
userRepository.save(user);
}
}

0 comments on commit 315ce76

Please sign in to comment.