Skip to content

Commit

Permalink
Merge pull request #51 from UMC-neoul/develop
Browse files Browse the repository at this point in the history
상품 할인률 관련 코드 수정
  • Loading branch information
sujinyang00 committed Aug 21, 2023
2 parents 687cdc3 + 9d71730 commit ada0ac1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/com/example/neoul/dto/product/ProductRes.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ public class ProductRes {
@Setter
@Getter
// main - 상품 상세조회
public static class ProductDetailRes {
public static class ProductDetailRes { //todo 상품 할인률, 할인가 추가
private Long productId; //상품 id
private Long brandId; //브랜드 id
private Long categoryPId; //카테고리 id
private String categoryName; //상품 카테고리
private String productName; //상품명
private Integer price; //상품금액
private Integer discountedRatio; //상품 할인률
private Integer discountedSalePrice; //상품 할인가
private List<String> productImgList; //상품사진
private String deliveryInfo; //상품 배송정보 (무료배송 etc..)
private String productUrl; //상품상세 url
Expand Down Expand Up @@ -71,9 +73,15 @@ public static class getLikedProductRes {
@Builder
@Setter
@Getter
public static class LikedProductList {
private Long productId; //브랜드 id
private String productName; //브랜드 이름
public static class LikedProductList { //상품 이미지,브랜드 이름, 가격, 할인률 추가
private Long productId; //상품 id
private String productName; //상품명
private List<String> productImgList; //상품사진
private Long brandId; //브랜드 id
private String brandName; //브랜드 이름
private Integer price; //상품금액
private Integer discountedRatio; //상품 할인률
private Integer discountedSalePrice; //상품 할인가
}


Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/example/neoul/entity/brand/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public class Product extends BaseEntity {

private Integer price;

@Column(name = "discounted_ratio")
private Integer discountedRatio; //상품 할인률

@Column(name = "discounted_sale_price")
private Integer discountedSalePrice; //상품 할인가

@Column(name = "delivery_info")
private String deliveryInfo; //배송정보

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/example/neoul/service/ProductService.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public ProductRes.ProductDetailRes getProduct(Long productId) {
.categoryName(product.getCategoryP().getName()) //얘는 살려야함
.productName(product.getName())
.price(product.getPrice())
.discountedRatio(product.getDiscountedRatio())
.discountedSalePrice(product.getDiscountedSalePrice())
.productImgList(productImgList) //얘는 살려야함
.deliveryInfo(product.getDeliveryInfo())
.productUrl(product.getProductUrl())
Expand Down

0 comments on commit ada0ac1

Please sign in to comment.