-
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.
- Loading branch information
1 parent
67efd5f
commit 79bb59b
Showing
10 changed files
with
196 additions
and
17 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
31 changes: 31 additions & 0 deletions
31
src/main/java/org/devcourse/resumeme/business/event/controller/dto/EventUpdateRequest.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,31 @@ | ||
package org.devcourse.resumeme.business.event.controller.dto; | ||
|
||
import org.devcourse.resumeme.business.event.service.vo.EventUpdateVo; | ||
import org.devcourse.resumeme.common.domain.Position; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import static org.devcourse.resumeme.common.util.Validator.notNull; | ||
|
||
public record EventUpdateRequest(EventInfoRequest info, EventTimeRequest time, List<String> positions) { | ||
|
||
public EventUpdateVo toVo(Long eventId) { | ||
notNull(positions); | ||
List<Position> positionEntities = positions.stream() | ||
.map(position -> Position.valueOf(position.toUpperCase())) | ||
.toList(); | ||
|
||
return new EventUpdateVo(eventId, info.title, info.content, info().maximumAttendee, positionEntities, | ||
time.openDateTime, time.closeDateTime, time.endDate); | ||
} | ||
|
||
public record EventInfoRequest(String title, String content, int maximumAttendee) { | ||
|
||
} | ||
|
||
public record EventTimeRequest(LocalDateTime openDateTime, LocalDateTime closeDateTime, LocalDateTime endDate) { | ||
|
||
} | ||
|
||
} |
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
47 changes: 47 additions & 0 deletions
47
src/main/java/org/devcourse/resumeme/business/event/service/vo/EventUpdateVo.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,47 @@ | ||
package org.devcourse.resumeme.business.event.service.vo; | ||
|
||
import lombok.Getter; | ||
import org.devcourse.resumeme.business.event.domain.Event; | ||
import org.devcourse.resumeme.common.domain.Position; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Getter | ||
public class EventUpdateVo { | ||
|
||
private final Long eventId; | ||
|
||
private String title; | ||
|
||
private String content; | ||
|
||
private int maximumAttendee; | ||
|
||
private final List<Position> positions; | ||
|
||
private final LocalDateTime openDateTime; | ||
|
||
private final LocalDateTime closeDateTime; | ||
|
||
private final LocalDateTime endDateTime; | ||
|
||
public EventUpdateVo(Long eventId, String title, String content, int maximumAttendee, List<Position> positions, | ||
LocalDateTime openDateTime, LocalDateTime closeDateTime, LocalDateTime endDateTime) { | ||
this.eventId = eventId; | ||
this.title = title; | ||
this.content = content; | ||
this.maximumAttendee = maximumAttendee; | ||
this.positions = positions; | ||
this.openDateTime = openDateTime; | ||
this.closeDateTime = closeDateTime; | ||
this.endDateTime = endDateTime; | ||
} | ||
|
||
public void update(Event event) { | ||
event.updateInfo(title, content, maximumAttendee); | ||
event.updatePosition(positions); | ||
event.updateTimeInfo(openDateTime, closeDateTime, endDateTime); | ||
} | ||
|
||
} |
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