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("상품 찜이 취소가 되었습니다"); } diff --git a/src/main/java/com/example/neoul/service/ProductService.java b/src/main/java/com/example/neoul/service/ProductService.java index ee85629..c23e128 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().getBrand().getId()) + .brandName(userLikedProduct.getProduct().getBrand().getName()) + .price(userLikedProduct.getProduct().getPrice()) + .discountedRatio(userLikedProduct.getProduct().getDiscountedRatio()) + .discountedSalePrice(userLikedProduct.getProduct().getDiscountedSalePrice()) .build(); list.add(e); }