From 8227e186beeabf8bf8ae5df0b44c672385e699b8 Mon Sep 17 00:00:00 2001 From: sinkyoungdeok Date: Thu, 30 May 2024 00:48:20 +0900 Subject: [PATCH] =?UTF-8?q?[KAAN-000]=20review=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=EC=9D=BC,=20=EC=88=98=EC=A0=95=EC=9D=BC=20response=EC=97=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/restaurant/be/review/domain/entity/Review.kt | 4 +++- .../be/review/presentation/dto/common/ReviewDto.kt | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/restaurant/be/review/domain/entity/Review.kt b/src/main/kotlin/com/restaurant/be/review/domain/entity/Review.kt index a9efc78..4814397 100644 --- a/src/main/kotlin/com/restaurant/be/review/domain/entity/Review.kt +++ b/src/main/kotlin/com/restaurant/be/review/domain/entity/Review.kt @@ -96,7 +96,9 @@ class Review( imageUrls = images.map { it.imageUrl }, isLike = doesUserLike, viewCount = viewCount, - likeCount = likeCount + likeCount = likeCount, + createdAt = createdAt, + modifiedAt = modifiedAt ) } } diff --git a/src/main/kotlin/com/restaurant/be/review/presentation/dto/common/ReviewDto.kt b/src/main/kotlin/com/restaurant/be/review/presentation/dto/common/ReviewDto.kt index 03206b0..d787dc5 100644 --- a/src/main/kotlin/com/restaurant/be/review/presentation/dto/common/ReviewDto.kt +++ b/src/main/kotlin/com/restaurant/be/review/presentation/dto/common/ReviewDto.kt @@ -4,6 +4,7 @@ import com.restaurant.be.review.domain.entity.Review import com.restaurant.be.user.domain.entity.User import io.swagger.annotations.ApiModelProperty import io.swagger.v3.oas.annotations.media.Schema +import java.time.LocalDateTime import javax.validation.constraints.NotBlank import javax.validation.constraints.NotNull @@ -51,7 +52,11 @@ data class ReviewResponseDto( @Schema(description = "좋아요 받은 횟수") val likeCount: Long, @Schema(description = "리뷰 조회 수") - val viewCount: Long + val viewCount: Long, + @Schema(description = "리뷰 생성 시간") + val createdAt: LocalDateTime, + @Schema(description = "리뷰 수정 시간") + val modifiedAt: LocalDateTime ) { companion object { fun toDto(review: Review, isLikedByUser: Boolean? = null): ReviewResponseDto { @@ -66,7 +71,9 @@ data class ReviewResponseDto( imageUrls = review.images.map { it.imageUrl }, isLike = isLikedByUser ?: false, likeCount = review.likeCount, - viewCount = review.viewCount + viewCount = review.viewCount, + createdAt = review.createdAt, + modifiedAt = review.modifiedAt ) } }