From 3d6785cfcbaae4a2526682522223e6141d847a25 Mon Sep 17 00:00:00 2001 From: sypark Date: Wed, 15 Oct 2025 15:26:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix[#342]:=20weekly=20goal=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EB=88=84=EB=9D=BD?= =?UTF-8?q?=EB=90=9C=20fetch=20join=20=EA=B5=AC=EB=AC=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recordit/goal/repository/CustomWeeklyGoalRepository.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sillim/recordit/goal/repository/CustomWeeklyGoalRepository.java b/src/main/java/com/sillim/recordit/goal/repository/CustomWeeklyGoalRepository.java index 1e2ed5b4..1e522aa0 100644 --- a/src/main/java/com/sillim/recordit/goal/repository/CustomWeeklyGoalRepository.java +++ b/src/main/java/com/sillim/recordit/goal/repository/CustomWeeklyGoalRepository.java @@ -10,6 +10,7 @@ public interface CustomWeeklyGoalRepository { List findWeeklyGoalInMonth(Integer year, Integer month, Long calendarId); - @Query("select wg from WeeklyGoal wg left join fetch wg.calendar where wg.id = :id") + @Query( + "select wg from WeeklyGoal wg left join fetch wg.calendar left join fetch wg.category left join fetch wg.relatedMonthlyGoal where wg.id = :id") Optional findWeeklyGoalById(@Param("id") Long id); } From 1726241fed0c3cba5e9d63712b72835b2b0e6b36 Mon Sep 17 00:00:00 2001 From: sypark Date: Wed, 15 Oct 2025 15:27:15 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix[#342]:=20goal=20=EC=A1=B0=ED=9A=8C=20ap?= =?UTF-8?q?i=20=EC=9D=91=EB=8B=B5=20=ED=95=84=EB=93=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goal/dto/response/MonthlyGoalListResponse.java | 12 ++---------- .../goal/dto/response/WeeklyGoalDetailsResponse.java | 2 ++ .../goal/dto/response/WeeklyGoalResponse.java | 9 +++------ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/sillim/recordit/goal/dto/response/MonthlyGoalListResponse.java b/src/main/java/com/sillim/recordit/goal/dto/response/MonthlyGoalListResponse.java index 3f998063..22e63bd3 100644 --- a/src/main/java/com/sillim/recordit/goal/dto/response/MonthlyGoalListResponse.java +++ b/src/main/java/com/sillim/recordit/goal/dto/response/MonthlyGoalListResponse.java @@ -2,22 +2,14 @@ import com.sillim.recordit.goal.domain.MonthlyGoal; -public record MonthlyGoalListResponse( - Long id, - String title, - Long categoryId, - String colorHex, - Boolean achieved, - Long calendarId) { +public record MonthlyGoalListResponse(Long id, String title, String colorHex, Boolean achieved) { public static MonthlyGoalListResponse from(final MonthlyGoal monthlyGoal) { return new MonthlyGoalListResponse( monthlyGoal.getId(), monthlyGoal.getTitle(), - monthlyGoal.getCategory().getId(), monthlyGoal.getColorHex(), - monthlyGoal.isAchieved(), - monthlyGoal.getCalendar().getId()); + monthlyGoal.isAchieved()); } } diff --git a/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalDetailsResponse.java b/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalDetailsResponse.java index 5ae77afc..7df9ffd6 100644 --- a/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalDetailsResponse.java +++ b/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalDetailsResponse.java @@ -27,6 +27,7 @@ public static WeeklyGoalDetailsResponse from(final WeeklyGoal weeklyGoal) { .week(weeklyGoal.getWeek()) .startDate(weeklyGoal.getStartDate()) .endDate(weeklyGoal.getEndDate()) + .calendarId(weeklyGoal.getCalendar().getId()) .categoryId(weeklyGoal.getCategory().getId()) .colorHex(weeklyGoal.getColorHex()) .build(); @@ -38,6 +39,7 @@ public static WeeklyGoalDetailsResponse from(final WeeklyGoal weeklyGoal) { .week(weeklyGoal.getWeek()) .startDate(weeklyGoal.getStartDate()) .endDate(weeklyGoal.getEndDate()) + .calendarId(weeklyGoal.getCalendar().getId()) .categoryId(weeklyGoal.getCategory().getId()) .colorHex(weeklyGoal.getColorHex()) .relatedMonthlyGoal( diff --git a/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalResponse.java b/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalResponse.java index 0a53892e..a66b2915 100644 --- a/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalResponse.java +++ b/src/main/java/com/sillim/recordit/goal/dto/response/WeeklyGoalResponse.java @@ -7,10 +7,9 @@ public record WeeklyGoalResponse( Long id, String title, - Long categoryId, + Integer week, String colorHex, Boolean achieved, - Long calendarId, RelatedMonthlyGoalResponse relatedMonthlyGoal) { public static WeeklyGoalResponse from(final WeeklyGoal weeklyGoal) { @@ -19,19 +18,17 @@ public static WeeklyGoalResponse from(final WeeklyGoal weeklyGoal) { return WeeklyGoalResponse.builder() .id(weeklyGoal.getId()) .title(weeklyGoal.getTitle()) - .categoryId(weeklyGoal.getCategory().getId()) + .week(weeklyGoal.getWeek()) .colorHex(weeklyGoal.getColorHex()) .achieved(weeklyGoal.isAchieved()) - .calendarId(weeklyGoal.getCalendar().getId()) .build(); } return WeeklyGoalResponse.builder() .id(weeklyGoal.getId()) .title(weeklyGoal.getTitle()) - .categoryId(weeklyGoal.getCategory().getId()) + .week(weeklyGoal.getWeek()) .colorHex(weeklyGoal.getColorHex()) .achieved(weeklyGoal.isAchieved()) - .calendarId(weeklyGoal.getCalendar().getId()) .relatedMonthlyGoal( RelatedMonthlyGoalResponse.from(weeklyGoal.getRelatedMonthlyGoal().get())) .build(); From fd01d2c2dccc599f180dd58cf0a94d574c6309a1 Mon Sep 17 00:00:00 2001 From: sypark Date: Wed, 15 Oct 2025 16:50:10 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix[#342]:=20=EB=88=84=EB=9D=BD=EB=90=9C=20?= =?UTF-8?q?calendar=20response=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recordit/calendar/dto/response/CalendarResponse.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sillim/recordit/calendar/dto/response/CalendarResponse.java b/src/main/java/com/sillim/recordit/calendar/dto/response/CalendarResponse.java index f8e1bae4..b077d3a2 100644 --- a/src/main/java/com/sillim/recordit/calendar/dto/response/CalendarResponse.java +++ b/src/main/java/com/sillim/recordit/calendar/dto/response/CalendarResponse.java @@ -2,9 +2,13 @@ import com.sillim.recordit.calendar.domain.Calendar; -public record CalendarResponse(Long id, String title, String colorHex) { +public record CalendarResponse(Long id, String title, String colorHex, Long categoryId) { public static CalendarResponse from(Calendar calendar) { - return new CalendarResponse(calendar.getId(), calendar.getTitle(), calendar.getColorHex()); + return new CalendarResponse( + calendar.getId(), + calendar.getTitle(), + calendar.getColorHex(), + calendar.getCategory().getId()); } }