From 3a347ae5e95bf7e48c2f3e894b7a59d6cc931bf1 Mon Sep 17 00:00:00 2001 From: bbbang105 <2018111366@dgu.ac.kr> Date: Fri, 25 Oct 2024 13:44:24 +0900 Subject: [PATCH 1/2] =?UTF-8?q?#98=20[feat]=20:=20record=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=EB=A5=BC=20=EB=B0=98=ED=99=98=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../side/onetime/dto/event/response/GetMostPossibleTime.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/side/onetime/dto/event/response/GetMostPossibleTime.java b/src/main/java/side/onetime/dto/event/response/GetMostPossibleTime.java index defc48b..75b331b 100644 --- a/src/main/java/side/onetime/dto/event/response/GetMostPossibleTime.java +++ b/src/main/java/side/onetime/dto/event/response/GetMostPossibleTime.java @@ -41,8 +41,8 @@ public static GetMostPossibleTime dateOf(Schedule schedule, List possibl ); } - public void updateEndTime(String endTime) { - new GetMostPossibleTime( + public GetMostPossibleTime updateEndTime(String endTime) { + return new GetMostPossibleTime( this.timePoint, this.startTime, addThirtyMinutes(endTime), From 4ce46dbedeb6c8ed816a975750bb73c5e6d27622 Mon Sep 17 00:00:00 2001 From: bbbang105 <2018111366@dgu.ac.kr> Date: Fri, 25 Oct 2024 13:45:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?#98=20[fix]=20:=20=EA=B0=80=EC=9E=A5=20?= =?UTF-8?q?=EB=A7=8E=EC=9D=B4=20=EB=90=98=EB=8A=94=20=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EC=9D=B4=20=EC=9D=B4=EC=96=B4=EC=A7=80=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=EB=A5=BC=20=ED=95=B4=EA=B2=B0?= =?UTF-8?q?=ED=95=9C=EB=8B=A4=20(record=EB=8A=94=20=EB=B6=88=EB=B3=80=20?= =?UTF-8?q?=EA=B0=9D=EC=B2=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/side/onetime/service/EventService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/side/onetime/service/EventService.java b/src/main/java/side/onetime/service/EventService.java index 2b23aa1..c004c12 100644 --- a/src/main/java/side/onetime/service/EventService.java +++ b/src/main/java/side/onetime/service/EventService.java @@ -224,13 +224,17 @@ private List buildMostPossibleTimes(Map curNames = entry.getValue(); if (curNames.size() == mostPossibleCnt) { + // 이전 시간대와 병합 가능한 경우 if (canMergeWithPrevious(previousTime, schedule, curNames, category)) { - previousTime.updateEndTime(schedule.getTime()); + // 종료 시간을 더해 업데이트 + previousTime = previousTime.updateEndTime(schedule.getTime()); + mostPossibleTimes.set(mostPossibleTimes.size() - 1, previousTime); } else { List impossibleNames = allMembersName.stream() .filter(name -> !curNames.contains(name)) .toList(); + // 새로운 시간대를 추가 GetMostPossibleTime newTime = createMostPossibleTime(schedule, curNames, impossibleNames, category); mostPossibleTimes.add(newTime); previousTime = newTime;