diff --git a/src/main/java/kr/bb/product/domain/product/mapper/ProductCommand.java b/src/main/java/kr/bb/product/domain/product/mapper/ProductCommand.java index 7f067b26..58772fa4 100644 --- a/src/main/java/kr/bb/product/domain/product/mapper/ProductCommand.java +++ b/src/main/java/kr/bb/product/domain/product/mapper/ProductCommand.java @@ -248,6 +248,7 @@ public static class ProductListItem { private Long salesCount; private Long reviewCount; private Long averageRating; + private ProductSaleStatus productSaleStatus; public static List getProductIds(List productListItem) { return productListItem.stream().map(ProductListItem::getKey).collect(Collectors.toList()); @@ -390,7 +391,7 @@ public static class StoreProductDetail { private String productDescriptionImage; private Long productSaleAmount; private Double averageRating; - private String productSaleStatus; + private ProductSaleStatus productSaleStatus; private ProductDetailFlower representativeFlower; private List flowers; @@ -422,7 +423,7 @@ public static StoreProductDetail fromEntity(Product product, List flower .productDescriptionImage(product.getProductDescriptionImage()) .productSaleAmount(product.getProductSaleAmount()) .averageRating(product.getAverageRating()) - .productSaleStatus(product.getProductSaleStatus().getMessage()) + .productSaleStatus(product.getProductSaleStatus()) .representativeFlower(representativeFlower) .flowers(flowerList) .build(); @@ -440,7 +441,7 @@ public static class StoreProduct { private Long productPrice; private Long productSaleAmount; private Double averageRating; - private String productSaleStatus; + private ProductSaleStatus productSaleStatus; public static StoreProduct fromEntity(Product product, String representativeFlower) { return StoreProduct.builder() @@ -450,7 +451,7 @@ public static StoreProduct fromEntity(Product product, String representativeFlow .productName(product.getProductName()) .productPrice(product.getProductPrice()) .productSaleAmount(product.getProductSaleAmount()) - .productSaleStatus(product.getProductSaleStatus().getMessage()) + .productSaleStatus(product.getProductSaleStatus()) .productThumbnail(product.getProductThumbnail()) .representativeFlower(representativeFlower) .build(); diff --git a/src/main/java/kr/bb/product/domain/product/mapper/mapper/ProductMapper.java b/src/main/java/kr/bb/product/domain/product/mapper/mapper/ProductMapper.java index a2a92ad8..fb51b4ed 100644 --- a/src/main/java/kr/bb/product/domain/product/mapper/mapper/ProductMapper.java +++ b/src/main/java/kr/bb/product/domain/product/mapper/mapper/ProductMapper.java @@ -68,6 +68,7 @@ List flowerRequestToFlowersList( @Mapping(target = "productPrice", source = "product.productPrice"), @Mapping(target = "reviewCount", source = "product.reviewCount"), @Mapping(target = "averageRating", source = "product.averageRating"), + @Mapping(target = "productSaleStatus", source = "product.productSaleStatus"), }) ProductListItem entityToListItem(Product product);