-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#316 [feat] presentation 계층과 service 계층 DTO 분리
- Loading branch information
Showing
5 changed files
with
67 additions
and
25 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
18 changes: 9 additions & 9 deletions
18
src/main/java/com/asap/server/service/UserMeetingScheduleService.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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/asap/server/service/dto/UserMeetingScheduleRegisterDto.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,26 @@ | ||
package com.asap.server.service.dto; | ||
|
||
import com.asap.server.persistence.domain.enums.TimeSlot; | ||
import com.asap.server.presentation.controller.dto.request.UserMeetingTimeSaveRequestDto; | ||
|
||
import java.util.List; | ||
|
||
public record UserMeetingScheduleRegisterDto( | ||
String month, | ||
String day, | ||
TimeSlot startTime, | ||
TimeSlot endTime, | ||
int priority | ||
) { | ||
|
||
public static List<UserMeetingScheduleRegisterDto> of(final List<UserMeetingTimeSaveRequestDto> targets) { | ||
return targets.stream().map( | ||
t -> new UserMeetingScheduleRegisterDto( | ||
t.month(), | ||
t.day(), | ||
t.startTime(), | ||
t.endTime(), | ||
t.priority() | ||
)).toList(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/asap/server/service/dto/UserTimeRegisterDto.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,14 @@ | ||
package com.asap.server.service.dto; | ||
|
||
import com.asap.server.presentation.controller.dto.request.AvailableTimeRequestDto; | ||
|
||
import java.util.List; | ||
|
||
public record UserTimeRegisterDto( | ||
String name, | ||
List<UserMeetingScheduleRegisterDto> availableSchedules | ||
) { | ||
public static UserTimeRegisterDto of(final AvailableTimeRequestDto target) { | ||
return new UserTimeRegisterDto(target.getName(), UserMeetingScheduleRegisterDto.of(target.getAvailableTimes())); | ||
} | ||
} |