From 16b8aa719826a75d7e7770019cb8a70f65ff033b Mon Sep 17 00:00:00 2001 From: joonghyun Date: Tue, 14 Mar 2023 17:09:05 +0900 Subject: [PATCH 1/2] =?UTF-8?q?#160=20feat:=20[=ED=8C=90=EB=A7=A4=EC=9E=90?= =?UTF-8?q?]=20=EC=83=81=ED=92=88=20=EC=88=98=EC=A0=95=20API=EC=97=90=20?= =?UTF-8?q?=EB=94=94=EC=9E=90=EC=9D=B8=20=EC=98=B5=EC=85=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../keki/common/BaseResponseStatus.java | 9 +++++ .../keki/dessert/dto/OptionDTO.java | 3 +- .../keki/dessert/dto/PatchDessertReq.java | 5 +++ .../keki/dessert/dto/PostDessertReq.java | 13 ++++++- .../keki/dessert/entity/Option.java | 8 +++++ .../dessert/repository/OptionRepository.java | 2 ++ .../keki/dessert/service/DessertService.java | 35 ++++++++++++++++--- 7 files changed, 69 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/codepatissier/keki/common/BaseResponseStatus.java b/src/main/java/com/codepatissier/keki/common/BaseResponseStatus.java index b471396..b5fcc2e 100644 --- a/src/main/java/com/codepatissier/keki/common/BaseResponseStatus.java +++ b/src/main/java/com/codepatissier/keki/common/BaseResponseStatus.java @@ -53,6 +53,10 @@ public enum BaseResponseStatus { INVALID_DESERT_PRICE(false, 3303, "디저트 가격은 0원 이상이어야 합니다."), NULL_DESSERT_DESCRIPTION(false, 3304, "디저트 설명을 입력해주세요."), DELETED_DESSERT(false, 3305, "이미 삭제된 디저트입니다."), + NULL_OPTION(false, 3306, "옵션을 입력해주세요."), + NULL_OPTION_IDX(false, 3307, "optionIdx를 입력해주세요."), + NULL_OPTION_DESCRIPTION(false, 3308, "옵션명을 입력해주세요."), + NULL_OPTION_PRICE(false, 3309, "옵션 가격을 입력해주세요."), // calendars(2400~2499) NULL_TITLE(false, 2400, "캘린더 제목을 입력해주세요."), @@ -66,6 +70,8 @@ public enum BaseResponseStatus { NULL_ORDER_IDX(false, 2700, "주문 아이디를 입력해주세요."), NULL_ORDER_STATUS(false, 2701, "주문 상태를 선택해주세요."), + // option(2800~2899) + /** * 3000: Response 오류 @@ -110,6 +116,9 @@ public enum BaseResponseStatus { NO_MATCH_ORDER_STATUS(false, 3702, "가능한 주문 상태가 아닙니다."), INVALID_ORDER_STATUS(false, 3703, "존재하지 않는 주문 상태 입니다."), + // option(3800~3899) + INVALID_OPTION_IDX(false, 3800, "존재하지 않는 옵션입니다."), + /** * 4000: DB, Server 오류 */ diff --git a/src/main/java/com/codepatissier/keki/dessert/dto/OptionDTO.java b/src/main/java/com/codepatissier/keki/dessert/dto/OptionDTO.java index 78924aa..d2d9874 100644 --- a/src/main/java/com/codepatissier/keki/dessert/dto/OptionDTO.java +++ b/src/main/java/com/codepatissier/keki/dessert/dto/OptionDTO.java @@ -8,6 +8,7 @@ @AllArgsConstructor @NoArgsConstructor public class OptionDTO { + private Long optionIdx; private String optionDescription; private Integer optionPrice; -} +} \ No newline at end of file diff --git a/src/main/java/com/codepatissier/keki/dessert/dto/PatchDessertReq.java b/src/main/java/com/codepatissier/keki/dessert/dto/PatchDessertReq.java index 743355f..dc1f378 100644 --- a/src/main/java/com/codepatissier/keki/dessert/dto/PatchDessertReq.java +++ b/src/main/java/com/codepatissier/keki/dessert/dto/PatchDessertReq.java @@ -1,11 +1,16 @@ package com.codepatissier.keki.dessert.dto; import lombok.Data; +import lombok.Getter; + +import java.util.List; @Data +@Getter public class PatchDessertReq { private String dessertImg; private String dessertName; private Integer dessertPrice; private String dessertDescription; + private List options; } \ No newline at end of file diff --git a/src/main/java/com/codepatissier/keki/dessert/dto/PostDessertReq.java b/src/main/java/com/codepatissier/keki/dessert/dto/PostDessertReq.java index c6eeb73..ab30e4a 100644 --- a/src/main/java/com/codepatissier/keki/dessert/dto/PostDessertReq.java +++ b/src/main/java/com/codepatissier/keki/dessert/dto/PostDessertReq.java @@ -1,6 +1,9 @@ package com.codepatissier.keki.dessert.dto; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -18,5 +21,13 @@ public class PostDessertReq { private String dessertDescription; @NotBlank(message = "디저트 이미지는 필수 항목입니다.") private String dessertImg; - private List options; + private List