-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
9 changed files
with
84 additions
and
8 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
16 changes: 16 additions & 0 deletions
16
server/src/main/java/haengdong/event/application/request/EventMineAppResponse.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,16 @@ | ||
package haengdong.event.application.request; | ||
|
||
import haengdong.event.domain.event.Event; | ||
import java.time.LocalDateTime; | ||
import java.time.ZoneId; | ||
|
||
public record EventMineAppResponse( | ||
String eventId, | ||
String eventName, | ||
boolean isFinished, | ||
LocalDateTime createdAt | ||
) { | ||
public static EventMineAppResponse of(Event event, boolean isFinished) { | ||
return new EventMineAppResponse(event.getToken(), event.getName(), isFinished, LocalDateTime.ofInstant(event.getCreatedAt(), ZoneId.of("Asia/Seoul")) ); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
server/src/main/java/haengdong/event/presentation/response/EventMineResponse.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,16 @@ | ||
package haengdong.event.presentation.response; | ||
|
||
import haengdong.event.application.request.EventMineAppResponse; | ||
import java.time.LocalDateTime; | ||
|
||
public record EventMineResponse( | ||
String eventId, | ||
String eventName, | ||
boolean isFinished, | ||
LocalDateTime createdAt | ||
) { | ||
|
||
public static EventMineResponse of(EventMineAppResponse response) { | ||
return new EventMineResponse(response.eventId(), response.eventName(), response.isFinished(), response.createdAt()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
server/src/main/java/haengdong/event/presentation/response/EventsMineResponse.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,17 @@ | ||
package haengdong.event.presentation.response; | ||
|
||
import haengdong.event.application.request.EventMineAppResponse; | ||
import java.util.List; | ||
|
||
public record EventsMineResponse( | ||
List<EventMineResponse> events | ||
) { | ||
|
||
public static EventsMineResponse of(List<EventMineAppResponse> responses) { | ||
List<EventMineResponse> events = responses.stream() | ||
.map(EventMineResponse::of) | ||
.toList(); | ||
|
||
return new EventsMineResponse(events); | ||
} | ||
} |
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