Skip to content

Commit

Permalink
modify :: 키워드리뷰
Browse files Browse the repository at this point in the history
  • Loading branch information
meltapplee committed Sep 10, 2024
1 parent 42c14ab commit e541240
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/kotlin/org/meogo/domain/review/domain/Review.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Review(
@Column(nullable = false)
var content: String,

@Column(name = "key_word")
val keyWord: String?,

var picture: String?

) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ data class ReviewRequest(
val content: String,
val schoolId: Int,
val star: Float,
val keyWord: List<String>?,
val image: String?
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ class CreateReviewService(
fun execute(request: ReviewRequest) {
val user = userFacade.currentUser() ?: throw UserNotFoundException

val keyWord = request.keyWord?.joinToString(separator = ",")

reviewRepository.save(
Review(
date = LocalDateTime.now(),
userId = user.id!!,
schoolId = request.schoolId,
star = request.star,
content = request.content,
keyWord = keyWord,
picture = request.image
)
)
Expand Down

0 comments on commit e541240

Please sign in to comment.