diff --git a/src/main/java/com/codepatissier/keki/common/BaseResponseStatus.java b/src/main/java/com/codepatissier/keki/common/BaseResponseStatus.java index c865cde..7151496 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, "캘린더 제목을 입력해주세요."), @@ -61,6 +65,10 @@ public enum BaseResponseStatus { NULL_TAG(false, 2403, "태그를 입력해주세요"), // histories(2500~2599) + // cs(2600-2699) + // order(2700~2799) + NULL_ORDER_IDX(false, 2700, "주문 아이디를 입력해주세요."), + NULL_ORDER_STATUS(false, 2701, "주문 상태를 선택해주세요."), /** @@ -71,8 +79,9 @@ public enum BaseResponseStatus { EXIST_NICKNAME(false, 3001, "이미 사용 중인 닉네임입니다."), INVALID_EMAIL(false, 3002, "존재하지 않는 이메일입니다."), NO_STORE_ROLE(false, 3003, "판매자가 아닙니다."), - INVALID_USER_STATUS(false, 3004, "비활성화된 사용자입니다."), - EXPIRED_TOKEN(false, 3005, "만료된 토큰 값입니다."), + NO_CUSTOMER_ROLE(false, 3004, "구매자가 아닙니다."), + INVALID_USER_STATUS(false, 3005, "비활성화된 사용자입니다."), + EXPIRED_TOKEN(false, 3006, "만료된 토큰 값입니다."), // stores(3100~3199) INVALID_STORE_IDX(false, 3100, "존재하지 않는 스토어입니다."), @@ -83,6 +92,7 @@ public enum BaseResponseStatus { // desserts(3300~3399) INVALID_DESSERT_IDX(false, 3300, "존재하지 않는 디저트입니다."), + INVALID_OPTION_IDX(false, 3301, "존재하지 않는 옵션입니다."), // calendars(3400~3499) INVALID_CALENDAR_TAG(false, 3400, "캘린더 TAG를 찾을 수 없습니다."), @@ -100,6 +110,12 @@ public enum BaseResponseStatus { NO_NOTICE(false, 3600, "공지사항이 없습니다."), INVALID_NOTICE_IDX(false, 3601, "존재하지 않는 공지사항 입니다."), + // order(3700~3799) + INVALID_ORDER_IDX(false, 3700, "존재하지 않는 주문 입니다."), + NO_MATCH_ORDER_USER(false, 3701, "주문에 접근할 수 있는 사용자가 아닙니다."), + NO_MATCH_ORDER_STATUS(false, 3702, "가능한 주문 상태가 아닙니다."), + INVALID_ORDER_STATUS(false, 3703, "존재하지 않는 주문 상태 입니다."), + /** * 4000: DB, Server 오류 */ diff --git a/src/main/java/com/codepatissier/keki/dessert/dto/GetDessertRes.java b/src/main/java/com/codepatissier/keki/dessert/dto/GetDessertRes.java index 8ea4f63..bc52da5 100644 --- a/src/main/java/com/codepatissier/keki/dessert/dto/GetDessertRes.java +++ b/src/main/java/com/codepatissier/keki/dessert/dto/GetDessertRes.java @@ -16,6 +16,7 @@ public class GetDessertRes { private Integer dessertPrice; private String dessertDescription; private List images; + private List options; @Getter @AllArgsConstructor diff --git a/src/main/java/com/codepatissier/keki/dessert/dto/GetStoreDessertRes.java b/src/main/java/com/codepatissier/keki/dessert/dto/GetStoreDessertRes.java index 617c81d..37d50f4 100644 --- a/src/main/java/com/codepatissier/keki/dessert/dto/GetStoreDessertRes.java +++ b/src/main/java/com/codepatissier/keki/dessert/dto/GetStoreDessertRes.java @@ -4,6 +4,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.util.List; + @Data @AllArgsConstructor @NoArgsConstructor @@ -13,4 +15,5 @@ public class GetStoreDessertRes { 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/OptionDTO.java b/src/main/java/com/codepatissier/keki/dessert/dto/OptionDTO.java index 79b4280..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 String optionDescription; - private Integer optionPrice; -} + 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/entity/Option.java b/src/main/java/com/codepatissier/keki/dessert/entity/Option.java index b910bfc..8f1ad87 100644 --- a/src/main/java/com/codepatissier/keki/dessert/entity/Option.java +++ b/src/main/java/com/codepatissier/keki/dessert/entity/Option.java @@ -35,4 +35,12 @@ public Option(Dessert dessert, String description, Integer price) { this.description = description; this.price = price; } + + public void setDescription(String description) { + this.description = description; + } + + public void setPrice(Integer price) { + this.price = price; + } } diff --git a/src/main/java/com/codepatissier/keki/dessert/repository/OptionRepository.java b/src/main/java/com/codepatissier/keki/dessert/repository/OptionRepository.java index af47ef7..9008996 100644 --- a/src/main/java/com/codepatissier/keki/dessert/repository/OptionRepository.java +++ b/src/main/java/com/codepatissier/keki/dessert/repository/OptionRepository.java @@ -6,8 +6,10 @@ import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Optional; @Repository public interface OptionRepository extends JpaRepository { List