-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29 [Update] 업장 상세 조회에 review 이미지 추가
- Loading branch information
Showing
3 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/com/mpnp/baechelin/store/dto/StoreDetailResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.mpnp.baechelin.store.dto; | ||
|
||
import com.mpnp.baechelin.review.domain.Review; | ||
import com.mpnp.baechelin.store.domain.Store; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class StoreDetailResponseDto { | ||
private long storeId; | ||
private String category; | ||
private String name; | ||
private BigDecimal latitude; | ||
private BigDecimal longitude; | ||
private String address; | ||
private String elevator; | ||
private String toilet; | ||
private String parking; | ||
private String phoneNumber; | ||
private String heightDifferent; | ||
private String approach; | ||
private List<String> storeImgList; | ||
private int bookmarkCount; | ||
private String bookmark; | ||
@Builder.Default | ||
private double pointAvg = 0.0; | ||
|
||
public StoreDetailResponseDto(Store store, String isBookMark, List<String> imageList) { | ||
this.storeId = store.getId(); | ||
this.category = store.getCategory(); | ||
this.name = store.getName(); | ||
this.latitude = store.getLatitude(); | ||
this.longitude = store.getLongitude(); | ||
this.address = store.getAddress(); | ||
this.elevator = store.getElevator(); | ||
this.toilet = store.getToilet(); | ||
this.parking = store.getParking(); | ||
this.phoneNumber = store.getPhoneNumber(); | ||
this.heightDifferent = store.getHeightDifferent(); | ||
this.approach = store.getApproach(); | ||
this.bookmarkCount = store.getBookMarkCount(); | ||
this.storeImgList = imageList; | ||
this.pointAvg = Double.parseDouble(String.format(store.getReviewList().stream() | ||
.collect(Collectors.averagingDouble(Review::getPoint)).toString(), 0.1f)); | ||
this.bookmark = isBookMark; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters