Skip to content

Commit

Permalink
fix: 존재하지 않는 날짜 예외처리
Browse files Browse the repository at this point in the history
parameter를 @DateTimeFormat을 통해 LocalDate로 받도록 선언
  • Loading branch information
0703kyj committed Nov 21, 2023
1 parent 2047e47 commit d551a9c
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,9 @@ public Response<Object> findDiaryByDate(
@GetMapping("/week")
public Response<Object> findDiaryCountByWeek(
@LoginUserId Long memberId,
@RequestParam final int year,
@RequestParam final int month,
@RequestParam final int day){
@RequestParam("date") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate today){

DiaryWeekCountResponse response = diaryService.findDiaryCountByWeek(memberId,LocalDate.of(year,month,day));
DiaryWeekCountResponse response = diaryService.findDiaryCountByWeek(memberId,today);
return Response.ofSuccess("OK",response);
}
}

0 comments on commit d551a9c

Please sign in to comment.