From bd4c85509416f95d31f30165615b0194039bd074 Mon Sep 17 00:00:00 2001 From: subin Date: Sun, 7 Jul 2024 13:47:38 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20DB=20=EC=BB=AC=EB=9F=BC=20=EB=B3=80?= =?UTF-8?q?=ED=99=94=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - order_detail 컬럼에서 name,stock,option_name,brand_name 삭제 --- .../dto/request/AddOrderDetailRequest.java | 5 ----- .../dto/request/CreateOrderDetailRequest.java | 5 ----- .../dto/response/OrderDetailResponse.java | 10 +++++----- .../orderDetail/entity/OrderDetailEntity.java | 15 +-------------- 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/src/main/java/org/store/clothstar/orderDetail/dto/request/AddOrderDetailRequest.java b/src/main/java/org/store/clothstar/orderDetail/dto/request/AddOrderDetailRequest.java index fe69d584..54129eb2 100644 --- a/src/main/java/org/store/clothstar/orderDetail/dto/request/AddOrderDetailRequest.java +++ b/src/main/java/org/store/clothstar/orderDetail/dto/request/AddOrderDetailRequest.java @@ -45,11 +45,6 @@ public OrderDetailEntity toOrderDetailEntity(OrderEntity orderEntity, ProductLin .quantity(quantity) .fixedPrice(productLineEntity.getPrice()) .oneKindTotalPrice(quantity * productLineEntity.getPrice()) - .name(productLineEntity.getName()) - .stock(productEntity.getStock()) - .optionName(productEntity.getName()) -// .extraCharge(product.getExtraCharge()) - .brandName(productLineEntity.getSeller().getBrandName()) .build(); } } diff --git a/src/main/java/org/store/clothstar/orderDetail/dto/request/CreateOrderDetailRequest.java b/src/main/java/org/store/clothstar/orderDetail/dto/request/CreateOrderDetailRequest.java index 4372197d..106b59e7 100644 --- a/src/main/java/org/store/clothstar/orderDetail/dto/request/CreateOrderDetailRequest.java +++ b/src/main/java/org/store/clothstar/orderDetail/dto/request/CreateOrderDetailRequest.java @@ -41,11 +41,6 @@ public OrderDetailEntity toOrderDetailEntity(OrderEntity orderEntity, ProductLin .quantity(quantity) .fixedPrice(productLineEntity.getPrice()) .oneKindTotalPrice(quantity * productLineEntity.getPrice()) - .name(productLineEntity.getName()) - .stock(productEntity.getStock()) - .optionName(productEntity.getName()) -// .extraCharge(product.getExtraCharge()) - .brandName(productLineEntity.getSeller().getBrandName()) .build(); } } diff --git a/src/main/java/org/store/clothstar/orderDetail/dto/response/OrderDetailResponse.java b/src/main/java/org/store/clothstar/orderDetail/dto/response/OrderDetailResponse.java index 97b5aa34..931b7768 100644 --- a/src/main/java/org/store/clothstar/orderDetail/dto/response/OrderDetailResponse.java +++ b/src/main/java/org/store/clothstar/orderDetail/dto/response/OrderDetailResponse.java @@ -56,11 +56,11 @@ public static OrderDetailResponse fromOrderDetailEntity(OrderDetailEntity orderD .quantity(orderDetailEntity.getQuantity()) .fixedPrice(orderDetailEntity.getFixedPrice()) .oneKindTotalPrice(orderDetailEntity.getOneKindTotalPrice()) - .name(orderDetailEntity.getName()) - .stock(orderDetailEntity.getStock()) - .optionName(orderDetailEntity.getOptionName()) -// .extraCharge(orderDetail.getExtraCharge()) - .brandName(orderDetailEntity.getBrandName()) + .name(orderDetailEntity.getProductLine().getName()) + .stock(orderDetailEntity.getProduct().getStock()) + .optionName(orderDetailEntity.getProduct().getName()) + .extraCharge(orderDetailEntity.getProduct().getExtraCharge()) + .brandName(orderDetailEntity.getProductLine().getSeller().getBrandName()) .build(); } } diff --git a/src/main/java/org/store/clothstar/orderDetail/entity/OrderDetailEntity.java b/src/main/java/org/store/clothstar/orderDetail/entity/OrderDetailEntity.java index beb8f738..c6ca0cdb 100644 --- a/src/main/java/org/store/clothstar/orderDetail/entity/OrderDetailEntity.java +++ b/src/main/java/org/store/clothstar/orderDetail/entity/OrderDetailEntity.java @@ -27,18 +27,6 @@ public class OrderDetailEntity { @Column(name = "onekind_total_price") private int oneKindTotalPrice; // 상품 종류 하나당 총 가격 - // 상품 정보 - private String name; // 상품명 - - // 상품 옵션 정보 - private Long stock; // 옵션 상품 재고 - @Column(name = "option_name") - private String optionName; - - // 판매자 정보 - @Column(name = "brand_name") - private String brandName; - @ManyToOne @JoinColumn(name = "order_id") private OrderEntity order; @@ -50,5 +38,4 @@ public class OrderDetailEntity { @ManyToOne @JoinColumn(name = "product_id") private ProductEntity product; -} - +} \ No newline at end of file