Skip to content

Commit

Permalink
[KAAN-000] review 생성일, 수정일 response에 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkyoungdeok committed May 29, 2024
1 parent 3a0b305 commit 8227e18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ class Review(
imageUrls = images.map { it.imageUrl },
isLike = doesUserLike,
viewCount = viewCount,
likeCount = likeCount
likeCount = likeCount,
createdAt = createdAt,
modifiedAt = modifiedAt
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand All @@ -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
)
}
}
Expand Down

0 comments on commit 8227e18

Please sign in to comment.