| | |
| | | package com.tourguide.modules.review.dto; |
| | | |
| | | import com.tourguide.modules.review.entity.OrderReview; |
| | | import com.tourguide.modules.review.util.ReviewImageParser; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | public class GuideRatingItemResponse { |
| | |
| | | this.dateText = review.getReviewedAt() == null ? "" : review.getReviewedAt().format(DATE_FORMATTER); |
| | | this.score = review.getScore(); |
| | | this.comment = review.getContent(); |
| | | this.images = Collections.emptyList(); |
| | | this.images = parseImages(review.getImageUrls()); |
| | | } |
| | | |
| | | public Long getId() { return id; } |
| | |
| | | public BigDecimal getScore() { return score; } |
| | | public String getComment() { return comment; } |
| | | public List<String> getImages() { return images; } |
| | | |
| | | private static List<String> parseImages(String value) { |
| | | return ReviewImageParser.parse(value); |
| | | } |
| | | } |