-
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 #17 from CheckMate-sookmyung/feat/event
[Feat] 이벤트 등록시 ResponseDto 수정
- Loading branch information
Showing
5 changed files
with
52 additions
and
11 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
23 changes: 23 additions & 0 deletions
23
.../java/checkmate/com/checkmate/eventattendanceList/dto/EventAttendanceListResponseDto.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,23 @@ | ||
package checkmate.com.checkmate.eventattendanceList.dto; | ||
|
||
import checkmate.com.checkmate.eventattendanceList.domain.EventAttendanceList; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import static lombok.AccessLevel.PRIVATE; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access=PRIVATE) | ||
public class EventAttendanceListResponseDto { | ||
private final String studentName; | ||
private final int studentNumber; | ||
private final String major; | ||
|
||
public static EventAttendanceListResponseDto of(EventAttendanceList eventAttendanceList){ | ||
return new EventAttendanceListResponseDto( | ||
eventAttendanceList.getName(), | ||
eventAttendanceList.getStudentNumber(), | ||
eventAttendanceList.getMajor() | ||
); | ||
} | ||
} |
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
14 changes: 12 additions & 2 deletions
14
src/main/java/checkmate/com/checkmate/eventschedule/dto/EventScheduleResponseDto.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 |
---|---|---|
@@ -1,24 +1,34 @@ | ||
package checkmate.com.checkmate.eventschedule.dto; | ||
|
||
import checkmate.com.checkmate.eventattendanceList.dto.EventAttendanceListResponseDto; | ||
import checkmate.com.checkmate.eventattendanceList.dto.StudentInfoResponseDto; | ||
import checkmate.com.checkmate.eventschedule.domain.EventSchedule; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import static lombok.AccessLevel.PRIVATE; | ||
import static org.apache.commons.collections4.CollectionUtils.collect; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access=PRIVATE) | ||
public class EventScheduleResponseDto { | ||
private final String eventDate; | ||
private final String eventStartTime; | ||
private final String eventEndTime; | ||
private final List<EventAttendanceListResponseDto> eventAttendanceListResponseDtos; | ||
|
||
public static EventScheduleResponseDto of(EventSchedule eventSchedule){ | ||
List<EventAttendanceListResponseDto> eventAttendanceListResponses = eventSchedule.getEventAttendanceLists().stream() | ||
.map(EventAttendanceListResponseDto::of) | ||
.collect(Collectors.toList()); | ||
return new EventScheduleResponseDto( | ||
eventSchedule.getEventDate(), | ||
eventSchedule.getEventStartTime(), | ||
eventSchedule.getEventEndTime() | ||
eventSchedule.getEventEndTime(), | ||
eventAttendanceListResponses | ||
); | ||
|
||
} | ||
} |
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