From 64f92bb0607fc03e5cd9c6e3db1257abbf229aa7 Mon Sep 17 00:00:00 2001 From: sujinyang00 Date: Mon, 21 Aug 2023 23:33:59 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Fix:=20=EB=B8=8C=EB=9E=9C=EB=93=9C=20?= =?UTF-8?q?=EB=AA=85,=20=EC=83=81=ED=92=88=20imgUrl=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/neoul/service/ProductService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/example/neoul/service/ProductService.java b/src/main/java/com/example/neoul/service/ProductService.java index ee85629..aac4ccb 100644 --- a/src/main/java/com/example/neoul/service/ProductService.java +++ b/src/main/java/com/example/neoul/service/ProductService.java @@ -118,9 +118,22 @@ public ProductRes.getLikedProductRes getUserLikedProduct() { List list = new ArrayList<>(); for(UserLikedProduct userLikedProduct : userLikedProductList){ + List images = productImageRepository.findAllByProduct(userLikedProduct.getProduct()); + List productImgList = new ArrayList<>(); + + for(ProductImage productImage : images){ + productImgList.add(productImage.getUrl()); + } + ProductRes.LikedProductList e = ProductRes.LikedProductList.builder() .productId(userLikedProduct.getProduct().getId()) .productName(userLikedProduct.getProduct().getName()) + .productImgList(productImgList) + .brandId(userLikedProduct.getProduct().getId()) + .brandName(userLikedProduct.getProduct().getBrand().getName()) + .price(userLikedProduct.getProduct().getPrice()) + .discountedRatio(userLikedProduct.getProduct().getDiscountedRatio()) + .discountedSalePrice(userLikedProduct.getProduct().getDiscountedSalePrice()) .build(); list.add(e); } From e2c376a87679452febbee5b9319a6b46463b1051 Mon Sep 17 00:00:00 2001 From: sujinyang00 Date: Tue, 22 Aug 2023 00:22:32 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Fix:=20ProductService=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/neoul/service/ProductService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/neoul/service/ProductService.java b/src/main/java/com/example/neoul/service/ProductService.java index aac4ccb..c23e128 100644 --- a/src/main/java/com/example/neoul/service/ProductService.java +++ b/src/main/java/com/example/neoul/service/ProductService.java @@ -129,7 +129,7 @@ public ProductRes.getLikedProductRes getUserLikedProduct() { .productId(userLikedProduct.getProduct().getId()) .productName(userLikedProduct.getProduct().getName()) .productImgList(productImgList) - .brandId(userLikedProduct.getProduct().getId()) + .brandId(userLikedProduct.getProduct().getBrand().getId()) .brandName(userLikedProduct.getProduct().getBrand().getName()) .price(userLikedProduct.getProduct().getPrice()) .discountedRatio(userLikedProduct.getProduct().getDiscountedRatio()) From 2c180b91bce115a14c3a78c0e335fdccaa8f926c Mon Sep 17 00:00:00 2001 From: sujinyang00 Date: Tue, 22 Aug 2023 00:27:21 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Fix:=20return=20=EB=A9=94=EC=84=B8=EC=A7=80?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/neoul/controller/MyController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/neoul/controller/MyController.java b/src/main/java/com/example/neoul/controller/MyController.java index bc057ef..999df9a 100644 --- a/src/main/java/com/example/neoul/controller/MyController.java +++ b/src/main/java/com/example/neoul/controller/MyController.java @@ -52,7 +52,7 @@ public ApiResponse getUserLikedBrand(){ @PatchMapping("/product/like/{productId}") public ApiResponse likeProduct(@PathVariable("productId") Long productId){ productService.likeProduct(productId); - return new ApiResponse("브랜드를 찜했습니다"); + return new ApiResponse("상품을 찜했습니다"); } @@ -60,7 +60,7 @@ public ApiResponse likeProduct(@PathVariable("productId") Long productId @PatchMapping("/product/dislike/{productId}") public ApiResponse deleteLikedProduct(@PathVariable("productId") Long productId){ productService.deleteLikedProduct(productId); - return new ApiResponse("브랜드 찜이 취소가 되었습니다"); + return new ApiResponse("상품 찜이 취소가 되었습니다"); }