Skip to content

Commit

Permalink
feat: get self info api
Browse files Browse the repository at this point in the history
  • Loading branch information
hui1601 committed Feb 11, 2025
1 parent ecb7dd9 commit cb827ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/example/newsper/api/UserApiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ public ResponseEntity<Map<String, Object>> refresh(HttpServletRequest request, H
}
}

@GetMapping("/me")
@Operation(summary = "내 정보 조회", description = "내 정보를 조회합니다. 액세스 토큰 필요.")
public ResponseEntity<Map<String, Object>> me(HttpServletRequest request) {
String userId = userService.getUserId(request);
UserEntity user = userService.findById(userId);
return ResponseEntity.status(HttpStatus.OK).body(user.toJSON());
}

@GetMapping("/show")
@Operation(summary = "유저 정보 조회", description = "유저 정보를 조회합니다.")
public ResponseEntity<Map<String, Object>> show(@Parameter(description = "유저 ID") @RequestParam String id) {
Expand Down

0 comments on commit cb827ca

Please sign in to comment.