Skip to content

Commit

Permalink
SCRUM-123 사용자 포인트 조회 api
Browse files Browse the repository at this point in the history
  • Loading branch information
jin20fd committed Jul 29, 2024
1 parent dbb0e64 commit 92ef78b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ public ResponseEntity<MyPageRes> viewMypage(Authentication principal) {
MyPageRes myPageInfo = memberService.getMyPageInfo(principal.getName());
return ResponseEntity.status(HttpStatus.OK).body(myPageInfo);
}

@GetMapping("/point")
public ResponseEntity<Long> getPoint(Authentication principal) {
if (principal == null)
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
return ResponseEntity.status(HttpStatus.OK).body(memberService.getPoint(principal.getName()));
}


// @GetMapping("/test")
// public ResponseEntity<String> testToken() { return ResponseEntity.status(HttpStatus.OK).body(SecurityUtil.getCurrentEmail()); }
}
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,8 @@ public void checkAttend(String email) {
}
statRepository.save(todayStat);
}
public Long getPoint(String email) {
Member member = memberRepository.findMemberByEmail(email);
return member.getPoint();
}
}

0 comments on commit 92ef78b

Please sign in to comment.