Skip to content

Commit

Permalink
feat : 닉네임 조회 API
Browse files Browse the repository at this point in the history
  • Loading branch information
imenuuu committed Feb 4, 2024
1 parent b886c11 commit c8929a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
@RestController
@RequiredArgsConstructor
public class UserController {


private final UserService userService;
private final JwtService jwtService;
private final RefreshTokenRepository refreshTokenRepository;
Expand Down Expand Up @@ -179,4 +177,13 @@ public CommonResponse<String> patchNickname(
return CommonResponse.onSuccess("수정 완료되었습니다.");
}

@Operation(summary = "01-13 User 👤 유저 닉네임 조회", description = "유저 닉네임 조회")
@ApiErrorCodeExample(UserAuthErrorCode.class)
@GetMapping("/nickname")
public CommonResponse<UserResponse.UserNicknameDto> getNickname(
@AuthenticationPrincipal User user
){
return CommonResponse.onSuccess(new UserResponse.UserNicknameDto(user.getNickName()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,12 @@ public static class UserInfoDTO {

private Status status;
}

@NoArgsConstructor
@Getter
@AllArgsConstructor
@Builder
public static class UserNicknameDto {
private String nickname;
}
}

0 comments on commit c8929a6

Please sign in to comment.