From e54124052ac3d63cfa13450e2f507339acb35cf0 Mon Sep 17 00:00:00 2001 From: soohyeon Date: Tue, 10 Sep 2024 23:04:55 +0900 Subject: [PATCH] =?UTF-8?q?modify=20::=20=ED=82=A4=EC=9B=8C=EB=93=9C?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/org/meogo/domain/review/domain/Review.kt | 3 +++ .../domain/review/presentation/dto/request/ReviewRequest.kt | 1 + .../org/meogo/domain/review/service/CreateReviewService.kt | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/main/kotlin/org/meogo/domain/review/domain/Review.kt b/src/main/kotlin/org/meogo/domain/review/domain/Review.kt index c8ea4ae..5f38925 100644 --- a/src/main/kotlin/org/meogo/domain/review/domain/Review.kt +++ b/src/main/kotlin/org/meogo/domain/review/domain/Review.kt @@ -30,6 +30,9 @@ class Review( @Column(nullable = false) var content: String, + @Column(name = "key_word") + val keyWord: String?, + var picture: String? ) { diff --git a/src/main/kotlin/org/meogo/domain/review/presentation/dto/request/ReviewRequest.kt b/src/main/kotlin/org/meogo/domain/review/presentation/dto/request/ReviewRequest.kt index 8ac335b..9f915fc 100644 --- a/src/main/kotlin/org/meogo/domain/review/presentation/dto/request/ReviewRequest.kt +++ b/src/main/kotlin/org/meogo/domain/review/presentation/dto/request/ReviewRequest.kt @@ -7,5 +7,6 @@ data class ReviewRequest( val content: String, val schoolId: Int, val star: Float, + val keyWord: List?, val image: String? ) diff --git a/src/main/kotlin/org/meogo/domain/review/service/CreateReviewService.kt b/src/main/kotlin/org/meogo/domain/review/service/CreateReviewService.kt index 5f37e1f..62ab96f 100644 --- a/src/main/kotlin/org/meogo/domain/review/service/CreateReviewService.kt +++ b/src/main/kotlin/org/meogo/domain/review/service/CreateReviewService.kt @@ -19,6 +19,8 @@ class CreateReviewService( fun execute(request: ReviewRequest) { val user = userFacade.currentUser() ?: throw UserNotFoundException + val keyWord = request.keyWord?.joinToString(separator = ",") + reviewRepository.save( Review( date = LocalDateTime.now(), @@ -26,6 +28,7 @@ class CreateReviewService( schoolId = request.schoolId, star = request.star, content = request.content, + keyWord = keyWord, picture = request.image ) )