Skip to content

Commit e43bbd7

Browse files
committed
✨ feat: 데이트 코스 생성
1 parent 0dd7950 commit e43bbd7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/main/java/org/withtime/be/withtimebe/domain/date/converter/DateConverter.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ public static DateResponseDTO.DatePlace createDatePlace(DatePlace datePlace,
103103
public static DateResponseDTO.DatePlace createDatePlace(DatePlace datePlace,
104104
LocalDateTime startTime,
105105
LocalDateTime endTime) {
106+
List<DateResponseDTO.PlaceCategoryResponse> placeCategoryResponseList = datePlace.getPlaceCategories().stream().map((d) ->
107+
DateResponseDTO.PlaceCategoryResponse.builder()
108+
.placeCategoryType(d.getPlaceCategory().getCategoryType())
109+
.label(d.getPlaceCategory().getLabel())
110+
.code(d.getPlaceCategory().getCode())
111+
.description(d.getPlaceCategory().getDescription())
112+
.build()
113+
).toList();
114+
106115
return DateResponseDTO.DatePlace.builder()
107116
.datePlaceId(datePlace.getId())
108117
.name(datePlace.getName())
@@ -118,6 +127,7 @@ public static DateResponseDTO.DatePlace createDatePlace(DatePlace datePlace,
118127
.startTime(LocalTime.from(startTime))
119128
.endTime(LocalTime.from(endTime))
120129
.signatureDish(toSignatureDish(datePlace.getItems() == null || datePlace.getItems().isEmpty() ? null : datePlace.getItems().get(0)))
130+
.placeCategoryResponseList(placeCategoryResponseList)
121131
.build();
122132
}
123133

src/main/java/org/withtime/be/withtimebe/domain/date/dto/response/DateResponseDTO.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public record DatePlace(
3030
PlaceType placeType,
3131
LocalTime startTime,
3232
LocalTime endTime,
33-
SignatureDish signatureDish
33+
SignatureDish signatureDish,
34+
List<PlaceCategoryResponse> placeCategoryResponseList
3435
){}
3536

3637
@Builder
@@ -42,6 +43,14 @@ public record DateCourse(
4243
String signature
4344
){}
4445

46+
@Builder
47+
public record PlaceCategoryResponse (
48+
PlaceCategoryType placeCategoryType,
49+
String description,
50+
String code,
51+
String label
52+
){}
53+
4554
@Builder
4655
public record DateCourseList(
4756
List<DateResponseDTO.DateCourse> dateCourseList,

0 commit comments

Comments
 (0)