Skip to content

Commit

Permalink
[Fix] 캘린더: getMyCalendarByDate(DTO 수정)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonshn committed Sep 5, 2024
1 parent 67563a6 commit f84f372
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class CalendarController implements CalendarSwagger {
public ResponseEntity<JsonResponse> getCalendarByDate(@RequestParam("year") String year,
@RequestParam("month") String month,
@RequestParam("day") String day) {
log.info("[API] getCalendarByMonth - 캘린더 조회 (일별)");

String uuid = jwtService.resolveToken();
User user = userService.getUser(uuid);

return ResponseEntity.ok(new JsonResponse(true, 200, "getCalendarByDate", null));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,28 @@ public getMyCalendarEventRes(int parsedDate, boolean nextWatered, boolean prevWa
this.writeMemo = writeMemo;
}
}


/**
* 최종 My Calendar (By Date) Response
*/
@AllArgsConstructor
@NoArgsConstructor
@Getter
public static class getMyCalendarByDateRes {
private int year;
private int month;
private int day;

private List<getMyCalendarPlaceListRes> placesByDate;

@Builder
public getMyCalendarByDateRes(int year, int month, int day){
this.year = year;
this.month = month;
this.day = day;
}
}

/**
* My Calendar에 보여줄 Place 리스트
*/
Expand All @@ -61,6 +82,13 @@ public getMyCalendarEventRes(int parsedDate, boolean nextWatered, boolean prevWa
@Getter
public static class getMyCalendarPlaceListRes{
private String name;

private List<getMyCalendarPlantListRes> plantsByPlace;

@Builder
public getMyCalendarPlaceListRes(String name){
this.name = name;
}
}

/**
Expand All @@ -70,12 +98,16 @@ public static class getMyCalendarPlaceListRes{
@NoArgsConstructor
@Getter
public static class getMyCalendarPlantListRes{
private Long plantIdx;
private String plantName;
private String nickname;
private String imgUrl;

private List<getMyCalendarMemoRes> memosByPlant;

@Builder
public getMyCalendarPlantListRes(Plant plant){
this.plantIdx = plant.getPlantIdx();
this.plantName = plant.getPlantName();
this.nickname = plant.getNickname();
this.imgUrl = plant.getImgUrl();
Expand Down

0 comments on commit f84f372

Please sign in to comment.