Skip to content

Commit

Permalink
Merge pull request #439 from Zelusik/feature/#437-add-created-at-to-r…
Browse files Browse the repository at this point in the history
…eview-list-response

리뷰 리스트 조회 API 응답 데이터에 리뷰 생성 시각 추가
  • Loading branch information
Wo-ogie authored Apr 12, 2024
2 parents 005cbca + 5c3f991 commit 678a8e3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@AllArgsConstructor
Expand All @@ -40,14 +41,18 @@ public class FindReviewsResponse {
@Schema(description = "리뷰에 첨부된 썸네일 이미지 url")
private List<String> reviewThumbnailImageUrls;

@Schema(description = "리뷰 생성 시각")
private LocalDateTime createdAt;

public static FindReviewsResponse from(ReviewWithPlaceMarkedStatusDto dto) {
return new FindReviewsResponse(
dto.getId(),
dto.getWriter() != null ? WriterResponse.from(dto.getWriter()) : null,
dto.getPlace() != null ? PlaceResponse.from(dto.getPlace()) : null,
dto.getKeywords().stream().map(ReviewKeywordValue::getContent).toList(),
dto.getContent(),
dto.getReviewImageDtos().stream().map(ReviewImageDto::getThumbnailUrl).toList()
dto.getReviewImageDtos().stream().map(ReviewImageDto::getThumbnailUrl).toList(),
dto.getCreatedAt()
);
}

Expand Down

0 comments on commit 678a8e3

Please sign in to comment.