Skip to content

Commit

Permalink
Merge pull request #71 from 9oormDari/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
T-ferret authored Sep 28, 2024
2 parents 25657f8 + 85151f1 commit 2dff696
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,21 @@ public UserInfoResponse getCurrentUserInfo(@Parameter(description = "Accesstoken
return userService.getUserInfo(userId);
}

}
@Operation(summary = "ํ˜„์žฌ ์œ ์ € ํ”„๋กœํ•„ ์—…๋ฐ์ดํŠธ", description = "์œ ์ €์˜ nickname, username, password(์ง€๋‚œ ๋น„๋ฐ€๋ฒˆํ˜ธ ๊ฒ€์ฆ ๊ณผ์ • ์กด์žฌ) email, profileImageUrl ์—…๋ฐ์ดํŠธ ๊ธฐ๋Šฅ(null ๊ฐ’์œผ๋กœ ์ „์†ก ์‹œ, ์—…๋ฐ์ดํŠธ X)")
@PostMapping("/profile")
public UserInfoResponse updateCurrentUserInfo(@Parameter(description = "Accesstoken์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.", required = true) @RequestHeader("Authorization") String token,
@Valid @RequestBody UpdateUserRequest updateUserRequest) {
if (token == null) {
throw new InvalidTokenException();
}

String jwt = token.startsWith("Bearer ") ? token.substring(7) : token;
if (!jwtUtil.validateToken(jwt)) {
throw new IllegalArgumentException("Invalid token");
}
Long userId = jwtUtil.extractId(jwt);

return userService.updateUserProfile(userId, updateUserRequest);
}

}

0 comments on commit 2dff696

Please sign in to comment.