From 5cd5c47b6def1a786a7b10a03d430451c35d9a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EB=8C=80=EC=98=81?= <125343432+DaeYoung0726@users.noreply.github.com> Date: Sat, 3 Aug 2024 23:02:19 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Event=20Duration=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(#28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/gible/domain/event/api/EventApi.java | 3 +++ src/main/java/gible/domain/event/dto/EventDetailRes.java | 3 ++- src/main/java/gible/domain/event/dto/EventReq.java | 1 + src/main/java/gible/domain/event/dto/EventSummaryRes.java | 3 ++- src/main/java/gible/domain/event/entity/Event.java | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/gible/domain/event/api/EventApi.java b/src/main/java/gible/domain/event/api/EventApi.java index 5d177b1..fbff30d 100644 --- a/src/main/java/gible/domain/event/api/EventApi.java +++ b/src/main/java/gible/domain/event/api/EventApi.java @@ -50,11 +50,13 @@ public interface EventApi { { "eventId": "84a4e24c-d722-4479-ba8d-a3547f103fad", "title": "이벤트1", + "duration": "2024. 07. 13 ~ 2024. 07. 30", "imageUrl": "http://image-url.co.kr" }, { "eventId": "e91c03e2-2821-4e60-9c7e-b054cccfc3a3", "title": "이벤트2", + "duration": "2024. 07. 13 ~ 2024. 07. 30", "imageUrl": "http://image-url.co.kr" } ], @@ -96,6 +98,7 @@ ResponseEntity getAllEvents( "eventId": "e91c03e2-2821-4e60-9c7e-b054cccfc3a3", "title": "이벤트1", "content": "이벤트 참여해주세요~", + "duration": "2024. 07. 13 ~ 2024. 07. 30", "imageUrl": "http://image-url.co.kr" } """) diff --git a/src/main/java/gible/domain/event/dto/EventDetailRes.java b/src/main/java/gible/domain/event/dto/EventDetailRes.java index 59a29f2..2c1cafd 100644 --- a/src/main/java/gible/domain/event/dto/EventDetailRes.java +++ b/src/main/java/gible/domain/event/dto/EventDetailRes.java @@ -8,9 +8,10 @@ public record EventDetailRes( UUID eventId, String title, String content, + String duration, String imageUrl ) { public static EventDetailRes fromEntity(Event event) { - return new EventDetailRes(event.getId(), event.getTitle(), event.getContent(), event.getImageUrl()); + return new EventDetailRes(event.getId(), event.getTitle(), event.getContent(), event.getDuration(), event.getImageUrl()); } } diff --git a/src/main/java/gible/domain/event/dto/EventReq.java b/src/main/java/gible/domain/event/dto/EventReq.java index f3abe0a..d982482 100644 --- a/src/main/java/gible/domain/event/dto/EventReq.java +++ b/src/main/java/gible/domain/event/dto/EventReq.java @@ -8,6 +8,7 @@ public record EventReq( String title, @NotBlank(message = "내용은 필수 작성 항목입니다.") String content, + String duration, String imageUrl ) { public static Event toEntity(EventReq eventReq) { diff --git a/src/main/java/gible/domain/event/dto/EventSummaryRes.java b/src/main/java/gible/domain/event/dto/EventSummaryRes.java index 6ef7691..4e2d49a 100644 --- a/src/main/java/gible/domain/event/dto/EventSummaryRes.java +++ b/src/main/java/gible/domain/event/dto/EventSummaryRes.java @@ -7,9 +7,10 @@ public record EventSummaryRes( UUID eventId, String title, + String duration, String imageUrl ) { public static EventSummaryRes fromEntity(Event event) { - return new EventSummaryRes(event.getId(), event.getTitle(), event.getImageUrl()); + return new EventSummaryRes(event.getId(), event.getTitle(), event.getDuration(), event.getImageUrl()); } } diff --git a/src/main/java/gible/domain/event/entity/Event.java b/src/main/java/gible/domain/event/entity/Event.java index bb1032b..5a450bb 100644 --- a/src/main/java/gible/domain/event/entity/Event.java +++ b/src/main/java/gible/domain/event/entity/Event.java @@ -32,6 +32,8 @@ public class Event { @NotNull private String content; + private String duration; + @Enumerated(EnumType.STRING) private Region region;