From 2448f683413077d81868edd0cd135c74860ee5bc Mon Sep 17 00:00:00 2001 From: INKWON Date: Sat, 27 Jan 2024 16:56:18 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20store=20Response=20Dto=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=EA=B0=92=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/store/dto/response/CityStoreResponseDto.java | 8 ++++++-- .../domain/store/dto/response/PlaceStoreResponseDto.java | 9 +++++++-- .../store/dto/response/TripRecordStoreResponseDto.java | 8 ++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/CityStoreResponseDto.java b/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/CityStoreResponseDto.java index 75f16ef1..36f8dea6 100644 --- a/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/CityStoreResponseDto.java +++ b/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/CityStoreResponseDto.java @@ -6,14 +6,18 @@ public record CityStoreResponseDto( Long id, - Integer storeCount + String name, + Integer storeCount, + String imageUrl ) { public static CityStoreResponseDto fromEntity(CityStore cityStore) { City city = cityStore.getCity(); return new CityStoreResponseDto( city.getId(), - city.getStoreCount() + city.getName(), + city.getStoreCount(), + city.getImageUrl() ); } } \ No newline at end of file diff --git a/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/PlaceStoreResponseDto.java b/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/PlaceStoreResponseDto.java index d43fd1b1..0d274166 100644 --- a/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/PlaceStoreResponseDto.java +++ b/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/PlaceStoreResponseDto.java @@ -3,20 +3,25 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.haejwo.tripcometrue.domain.place.entity.Place; import com.haejwo.tripcometrue.domain.store.entity.PlaceStore; +import jakarta.persistence.criteria.CriteriaBuilder.In; import java.time.LocalTime; public record PlaceStoreResponseDto( Long id, + String name, + Integer commentCount, Integer storedCount, - Long cityId + String imageUrl ) { public static PlaceStoreResponseDto fromEntity(PlaceStore placeStore, String imageUrl) { Place place = placeStore.getPlace(); return new PlaceStoreResponseDto( place.getId(), + place.getName(), + place.getCommentCount(), place.getStoredCount(), - place.getCity().getId() + imageUrl ); } } \ No newline at end of file diff --git a/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/TripRecordStoreResponseDto.java b/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/TripRecordStoreResponseDto.java index 9c9f5fe3..397f1b5f 100644 --- a/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/TripRecordStoreResponseDto.java +++ b/src/main/java/com/haejwo/tripcometrue/domain/store/dto/response/TripRecordStoreResponseDto.java @@ -7,14 +7,18 @@ public record TripRecordStoreResponseDto( Long id, - Integer storeCount + String title, + Integer storeCount, + String imageUrl ) { public static TripRecordStoreResponseDto fromEntity(TripRecordStore tripRecordStore, String imageUrl) { TripRecord tripRecord = tripRecordStore.getTripRecord(); return new TripRecordStoreResponseDto( tripRecord.getId(), - tripRecord.getStoreCount() + tripRecord.getTitle(), + tripRecord.getStoreCount(), + imageUrl ); } } \ No newline at end of file