Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] store Response Dto 필드값 정리 #134

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
Loading