Skip to content

Commit

Permalink
feat: Event Duration 필드 추가 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
daeyoung0726 authored Aug 3, 2024
1 parent 3a48a66 commit 5cd5c47
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/java/gible/domain/event/api/EventApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
],
Expand Down Expand Up @@ -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"
}
""")
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gible/domain/event/dto/EventDetailRes.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
1 change: 1 addition & 0 deletions src/main/java/gible/domain/event/dto/EventReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public record EventReq(
String title,
@NotBlank(message = "내용은 필수 작성 항목입니다.")
String content,
String duration,
String imageUrl
) {
public static Event toEntity(EventReq eventReq) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gible/domain/event/dto/EventSummaryRes.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
2 changes: 2 additions & 0 deletions src/main/java/gible/domain/event/entity/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class Event {
@NotNull
private String content;

private String duration;

@Enumerated(EnumType.STRING)
private Region region;

Expand Down

0 comments on commit 5cd5c47

Please sign in to comment.