-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from Guzzing/academy-schedules
학원 스케줄 퍼사드 패턴 도입 및 Etag 도입으로 인한 응답 사이즈 개선
- Loading branch information
Showing
19 changed files
with
363 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...zing/studayserver/domain/calendar/facade/dto/AcademyScheduleLoadToUpdateFacadeResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.guzzing.studayserver.domain.calendar.facade.dto; | ||
|
||
import org.guzzing.studayserver.domain.calendar.controller.dto.response.AcademyCalendarLoadToUpdateResponse; | ||
import org.guzzing.studayserver.domain.calendar.service.dto.result.AcademyCalendarLoadToUpdateResult; | ||
import org.guzzing.studayserver.domain.dashboard.service.access.dto.LessonScheduleAccessResult; | ||
import org.guzzing.studayserver.domain.dashboard.service.dto.response.DashboardScheduleAccessResult; | ||
|
||
import java.time.DayOfWeek; | ||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.List; | ||
|
||
public record AcademyScheduleLoadToUpdateFacadeResult( | ||
Long childId, | ||
Long academyId, | ||
Long lessonId, | ||
Long dashboardId, | ||
List<LessonScheduleInfo> lessonSchedule, | ||
LocalDate startDateOfAttendance, | ||
LocalDate endDateOfAttendance, | ||
boolean isAlarmed, | ||
String memo | ||
) { | ||
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm"); | ||
|
||
public static AcademyScheduleLoadToUpdateFacadeResult from( | ||
AcademyCalendarLoadToUpdateResult academyCalendarLoadToUpdateResult, | ||
DashboardScheduleAccessResult dashboardScheduleAccessResult | ||
) { | ||
return new AcademyScheduleLoadToUpdateFacadeResult( | ||
dashboardScheduleAccessResult.childId(), | ||
dashboardScheduleAccessResult.academyId(), | ||
dashboardScheduleAccessResult.lessonId(), | ||
academyCalendarLoadToUpdateResult.dashboardId(), | ||
dashboardScheduleAccessResult.lessonScheduleInAccessResponses() | ||
.stream() | ||
.map(LessonScheduleInfo::from) | ||
.toList(), | ||
academyCalendarLoadToUpdateResult.startDateOfAttendance(), | ||
academyCalendarLoadToUpdateResult.endDateOfAttendance(), | ||
academyCalendarLoadToUpdateResult.isAlarmed(), | ||
academyCalendarLoadToUpdateResult.memo() | ||
); | ||
} | ||
|
||
public record LessonScheduleInfo( | ||
DayOfWeek dayOfWeek, | ||
String lessonStartTime, | ||
String lessonEndTime | ||
) { | ||
|
||
public static LessonScheduleInfo from(LessonScheduleAccessResult lessonScheduleAccessResult) { | ||
return new LessonScheduleInfo( | ||
lessonScheduleAccessResult.dayOfWeek(), | ||
lessonScheduleAccessResult.lessonStartTime().format(TIME_FORMATTER), | ||
lessonScheduleAccessResult.lessonEndTime().format(TIME_FORMATTER) | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.