Skip to content

Commit

Permalink
[fix] 이미지 값을 빈 문자열로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sanghee0820 committed Nov 15, 2024
1 parent ca8ac17 commit c776e2c
Showing 1 changed file with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand All @@ -57,76 +57,76 @@ private static JsonNode facilityTree(String facility) {
}

public record MenuInfos(
List<String> menuImgUrls,
List<MenuInfo> menuList,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
LocalDateTime timeExp
List<String> menuImgUrls,
List<MenuInfo> menuList,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
LocalDateTime timeExp
) {

public static MenuInfos of(
List<String> menuImgUrls,
List<Menu> menus,
LocalDateTime menuUpdatedAt) {
List<String> menuImgUrls,
List<Menu> menus,
LocalDateTime menuUpdatedAt) {

List<MenuInfo> 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<Period> periodList,
List<OffDay> offdayList
List<Period> periodList,
List<OffDay> offdayList
) {

public static OpenHour of(List<OpenTime> openTimes,
List<team7.inplace.place.domain.OffDay> closeTimes
List<team7.inplace.place.domain.OffDay> closeTimes
) {
List<Period> 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<OffDay> 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) {
Expand Down

0 comments on commit c776e2c

Please sign in to comment.