From c776e2ca22ff58f41be744dd0651023c19ee7095 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Fri, 15 Nov 2024 14:07:53 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EA=B0=92?= =?UTF-8?q?=EC=9D=84=20=EB=B9=88=20=EB=AC=B8=EC=9E=90=EC=97=B4=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/dto/PlaceDetailInfo.java | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/main/java/team7/inplace/place/application/dto/PlaceDetailInfo.java b/src/main/java/team7/inplace/place/application/dto/PlaceDetailInfo.java index f4b75e44..40e91c65 100644 --- a/src/main/java/team7/inplace/place/application/dto/PlaceDetailInfo.java +++ b/src/main/java/team7/inplace/place/application/dto/PlaceDetailInfo.java @@ -14,29 +14,29 @@ import team7.inplace.video.domain.Video; public record PlaceDetailInfo( - PlaceInfo placeInfo, - JsonNode facilityInfo, - MenuInfos menuInfos, - OpenHour openHour, - PlaceLikes placeLikes, - String videoUrl + PlaceInfo placeInfo, + JsonNode facilityInfo, + MenuInfos menuInfos, + OpenHour openHour, + PlaceLikes placeLikes, + String videoUrl ) { public static PlaceDetailInfo from(Place place, Influencer influencer, Video video, - boolean isLiked, int numOfLikes, int numOfDislikes) { + boolean isLiked, int numOfLikes, int numOfDislikes) { String influencerName = (influencer != null) ? influencer.getName() : ""; String videoUrl = (video != null) ? video.getVideoUrl() : ""; return new PlaceDetailInfo( - PlaceInfo.of(place, influencerName, isLiked), - facilityTree(place.getFacility()), - MenuInfos.of( - place.getMenuboardphotourlList(), - place.getMenus(), - place.getMenuUpdatedAt()), - OpenHour.of(place.getOpenPeriods(), place.getOffDays()), - PlaceLikes.of(numOfLikes, numOfDislikes), - videoUrl + PlaceInfo.of(place, influencerName, isLiked), + facilityTree(place.getFacility()), + MenuInfos.of( + place.getMenuboardphotourlList(), + place.getMenus(), + place.getMenuUpdatedAt()), + OpenHour.of(place.getOpenPeriods(), place.getOffDays()), + PlaceLikes.of(numOfLikes, numOfDislikes), + videoUrl ); } @@ -57,76 +57,76 @@ private static JsonNode facilityTree(String facility) { } public record MenuInfos( - List menuImgUrls, - List menuList, - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") - LocalDateTime timeExp + List menuImgUrls, + List menuList, + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") + LocalDateTime timeExp ) { public static MenuInfos of( - List menuImgUrls, - List menus, - LocalDateTime menuUpdatedAt) { + List menuImgUrls, + List menus, + LocalDateTime menuUpdatedAt) { List menuList = menus.stream() - .map(menu -> new MenuInfo(menu.getPrice(), menu.isRecommend(), - menu.getMenuName(), menu.getMenuImgUrl(), menu.getDescription())) - .toList(); + .map(menu -> new MenuInfo(menu.getPrice(), menu.isRecommend(), + menu.getMenuName(), menu.getMenuImgUrl().trim(), menu.getDescription())) + .toList(); return new MenuInfos(menuImgUrls, menuList, menuUpdatedAt); } public record MenuInfo( - String price, - Boolean recommend, - String menuName, - String menuImgUrl, - String description + String price, + Boolean recommend, + String menuName, + String menuImgUrl, + String description ) { } } public record OpenHour( - List periodList, - List offdayList + List periodList, + List offdayList ) { public static OpenHour of(List openTimes, - List closeTimes + List closeTimes ) { List periods = openTimes.stream() - .map(time -> new Period(time.getTimeName(), time.getTimeSE(), time.getDayOfWeek())) - .toList(); + .map(time -> new Period(time.getTimeName(), time.getTimeSE(), time.getDayOfWeek())) + .toList(); List offDays = closeTimes.stream() - .map(closeTime -> new OffDay(closeTime.getHolidayName(), closeTime.getWeekAndDay(), - closeTime.getTemporaryHolidays())) - .toList(); + .map(closeTime -> new OffDay(closeTime.getHolidayName(), closeTime.getWeekAndDay(), + closeTime.getTemporaryHolidays())) + .toList(); return new OpenHour(periods, offDays); } public record Period( - String timeName, - String timeSE, - String dayOfWeek + String timeName, + String timeSE, + String dayOfWeek ) { } public record OffDay( - String holidayName, - String weekAndDay, - String temporaryHolidays + String holidayName, + String weekAndDay, + String temporaryHolidays ) { } } public record PlaceLikes( - Integer like, - Integer dislike + Integer like, + Integer dislike ) { public static PlaceLikes of(Integer numOfLikes, Integer numOfDislikes) {