From e8122ff24ca52ea9fc6424205449e95d33cb869f Mon Sep 17 00:00:00 2001 From: jyajoo Date: Thu, 17 Oct 2024 00:23:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[#453]=20feat:=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=ED=95=84=EC=88=98=20=EA=B0=9C=EC=88=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jeju/nanaland/domain/review/dto/ReviewRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java b/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java index 27e524a2..51d9d363 100644 --- a/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java +++ b/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java @@ -39,7 +39,7 @@ public static class CreateReviewDto { allowableValues = {"ANNIVERSARY", "CUTE", "LUXURY", "SCENERY", "KIND", "CHILDREN", "FRIEND", "PARENTS", "ALONE", "HALF", "RELATIVE", "PET", "OUTLET", "LARGE", "BATHROOM"} ) - @Size(min = 3, message = "최소 3개 선택 가능합니다.") + @Size(min = 1, message = "최소 1개 선택 가능합니다.") @Size(max = 6, message = "최대 6개까지 선택 가능합니다") private List reviewKeywords; @@ -70,7 +70,7 @@ public static class EditReviewDto { allowableValues = {"ANNIVERSARY", "CUTE", "LUXURY", "SCENERY", "KIND", "CHILDREN", "FRIEND", "PARENTS", "ALONE", "HALF", "RELATIVE", "PET", "OUTLET", "LARGE", "BATHROOM"} ) - @Size(min = 3, message = "최소 3개 선택 가능합니다.") + @Size(min = 1, message = "최소 1개 선택 가능합니다.") @Size(max = 6, message = "최대 6개까지 선택 가능합니다") private List reviewKeywords; From 0acc9bfe5d8e6ad5278f5053ab75aaacb1457138 Mon Sep 17 00:00:00 2001 From: jyajoo Date: Mon, 21 Oct 2024 19:48:43 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[#453]=20feat:=20NONE=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nanaland/domain/review/dto/ReviewRequest.java | 2 +- .../domain/review/entity/ReviewTypeKeyword.java | 5 +++-- .../nanaland/domain/review/service/ReviewService.java | 11 ++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java b/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java index 51d9d363..a33aaea6 100644 --- a/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java +++ b/src/main/java/com/jeju/nanaland/domain/review/dto/ReviewRequest.java @@ -37,7 +37,7 @@ public static class CreateReviewDto { description = "게시물 카테고리", example = "[\"ANNIVERSARY\", \"CUTE\", \"PET\" ]", allowableValues = {"ANNIVERSARY", "CUTE", "LUXURY", "SCENERY", "KIND", "CHILDREN", "FRIEND", - "PARENTS", "ALONE", "HALF", "RELATIVE", "PET", "OUTLET", "LARGE", "BATHROOM"} + "PARENTS", "ALONE", "HALF", "RELATIVE", "PET", "OUTLET", "LARGE", "BATHROOM", "NONE"} ) @Size(min = 1, message = "최소 1개 선택 가능합니다.") @Size(max = 6, message = "최대 6개까지 선택 가능합니다") diff --git a/src/main/java/com/jeju/nanaland/domain/review/entity/ReviewTypeKeyword.java b/src/main/java/com/jeju/nanaland/domain/review/entity/ReviewTypeKeyword.java index 676381df..c8cbf09d 100644 --- a/src/main/java/com/jeju/nanaland/domain/review/entity/ReviewTypeKeyword.java +++ b/src/main/java/com/jeju/nanaland/domain/review/entity/ReviewTypeKeyword.java @@ -23,7 +23,8 @@ public enum ReviewTypeKeyword { OUTLET(Type.AMENITIES, "콘센트 사용 가능", "Outlet available", "提供电源插座", "Soket tersedia", "Có ổ cắm điện"), LARGE(Type.AMENITIES, "넓은 장소", "Wide", "宽敞", "Luas", "Rộng rãi"), PARK(Type.AMENITIES, "주차장", "Parking lot", "停车场", "Tempat letak kereta", "Bãi đậu xe"), - BATHROOM(Type.AMENITIES, "깨끗한 화장실", "Clean toilet", "洁净的卫生间", "Tandas bersih", "Nhà vệ sinh sạch sẽ"); + BATHROOM(Type.AMENITIES, "깨끗한 화장실", "Clean toilet", "洁净的卫生间", "Tandas bersih", "Nhà vệ sinh sạch sẽ"), + NONE(Type.ETC, "", "", "", "", ""); private final Type type; private final String kr; @@ -52,6 +53,6 @@ public String getValueByLocale(Language language) { } public enum Type { - MOOD, COMPANION, AMENITIES + MOOD, COMPANION, AMENITIES, ETC } } diff --git a/src/main/java/com/jeju/nanaland/domain/review/service/ReviewService.java b/src/main/java/com/jeju/nanaland/domain/review/service/ReviewService.java index 5d7aa0d0..42170d8b 100644 --- a/src/main/java/com/jeju/nanaland/domain/review/service/ReviewService.java +++ b/src/main/java/com/jeju/nanaland/domain/review/service/ReviewService.java @@ -141,12 +141,13 @@ public void saveReview(MemberInfoDto memberInfoDto, Long id, Category category, throw new BadRequestException(REVIEW_KEYWORD_DUPLICATION.getMessage()); } - reviewKeywordStringSet.forEach(keyword -> - reviewKeywordRepository.save(ReviewKeyword.builder() + reviewKeywordStringSet.stream() + .map(ReviewTypeKeyword::valueOf) + .filter(keyword -> keyword != ReviewTypeKeyword.NONE) + .forEach(keyword -> reviewKeywordRepository.save(ReviewKeyword.builder() .review(review) - .reviewTypeKeyword(ReviewTypeKeyword.valueOf(keyword)) - .build()) - ); + .reviewTypeKeyword(keyword) + .build())); // reviewImageFile if (multipartFiles != null) {