Skip to content

Commit

Permalink
#160 feat: [판매자] 상품 등록 API에 디자인 요금 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
JoongHyun-Kim committed Mar 10, 2023
1 parent d93c61e commit a81c9a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
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;
Expand All @@ -21,13 +18,5 @@ public class PostDessertReq {
private String dessertDescription;
@NotBlank(message = "디저트 이미지는 필수 항목입니다.")
private String dessertImg;
private List<Option> options;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public static class Option {
private String optionDescription;
private Integer optionPrice;
}
private List<OptionDTO> options;
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void addDessert(Long userIdx, PostDessertReq postDessertReq) throws BaseE
.build();
dessertRepository.save(dessert);

for(PostDessertReq.Option option : postDessertReq.getOptions())
for(OptionDTO option : postDessertReq.getOptions())
saveOption(option, dessert);
} catch (BaseException e) {
throw e;
Expand All @@ -150,7 +150,7 @@ public void addDessert(Long userIdx, PostDessertReq postDessertReq) throws BaseE
}
}

private void saveOption(PostDessertReq.Option optionDTO, Dessert dessert) throws BaseException {
private void saveOption(OptionDTO optionDTO, Dessert dessert) throws BaseException {
try {
Option option = Option.builder()
.dessert(dessert)
Expand Down

0 comments on commit a81c9a0

Please sign in to comment.