From e3a77544324597d60dd5cea60572a4a0623e5dcb Mon Sep 17 00:00:00 2001 From: hershyYJ Date: Tue, 26 Nov 2024 13:53:49 +0900 Subject: [PATCH] [feature/#74] Add seller profile image to product details --- .../com/api/jaebichuri/product/dto/EndedProductDetailsDto.java | 3 +++ .../api/jaebichuri/product/dto/OngoingProductDetailsDto.java | 3 +++ .../api/jaebichuri/product/dto/UpcomingProductDetailsDto.java | 3 +++ .../java/com/api/jaebichuri/product/mapper/ProductMapper.java | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/main/java/com/api/jaebichuri/product/dto/EndedProductDetailsDto.java b/src/main/java/com/api/jaebichuri/product/dto/EndedProductDetailsDto.java index 2021e9f..2a6a803 100644 --- a/src/main/java/com/api/jaebichuri/product/dto/EndedProductDetailsDto.java +++ b/src/main/java/com/api/jaebichuri/product/dto/EndedProductDetailsDto.java @@ -33,6 +33,9 @@ public class EndedProductDetailsDto { @Schema(description = "경매 등록자 닉네임", example = "에코마켓") private String sellerNickname; + @Schema(description = "경매 등록자 프로필 이미지 URL", example = "http://example.com/profile.jpg") + private String sellerProfileImage; + @Schema(description = "상품 사진 URL 목록") private List images; diff --git a/src/main/java/com/api/jaebichuri/product/dto/OngoingProductDetailsDto.java b/src/main/java/com/api/jaebichuri/product/dto/OngoingProductDetailsDto.java index 6e7fba7..45ca051 100644 --- a/src/main/java/com/api/jaebichuri/product/dto/OngoingProductDetailsDto.java +++ b/src/main/java/com/api/jaebichuri/product/dto/OngoingProductDetailsDto.java @@ -37,6 +37,9 @@ public class OngoingProductDetailsDto { @Schema(description = "경매 등록자 닉네임", example = "에코마켓") private String sellerNickname; + @Schema(description = "경매 등록자 프로필 이미지 URL", example = "http://example.com/profile.jpg") + private String sellerProfileImage; + @Schema(description = "경매 마감 시간", example = "") private LocalDateTime endTime; diff --git a/src/main/java/com/api/jaebichuri/product/dto/UpcomingProductDetailsDto.java b/src/main/java/com/api/jaebichuri/product/dto/UpcomingProductDetailsDto.java index 89703c2..cbe7229 100644 --- a/src/main/java/com/api/jaebichuri/product/dto/UpcomingProductDetailsDto.java +++ b/src/main/java/com/api/jaebichuri/product/dto/UpcomingProductDetailsDto.java @@ -26,6 +26,9 @@ public class UpcomingProductDetailsDto { @Schema(description = "경매 등록자 닉네임", example = "에코마켓") private String sellerNickname; + @Schema(description = "경매 등록자 프로필 이미지 URL", example = "http://example.com/profile.jpg") + private String sellerProfileImage; + @Schema(description = "상품 사진 URL 목록") private List images; diff --git a/src/main/java/com/api/jaebichuri/product/mapper/ProductMapper.java b/src/main/java/com/api/jaebichuri/product/mapper/ProductMapper.java index 9fb5466..46f3179 100644 --- a/src/main/java/com/api/jaebichuri/product/mapper/ProductMapper.java +++ b/src/main/java/com/api/jaebichuri/product/mapper/ProductMapper.java @@ -23,6 +23,7 @@ public interface ProductMapper { @Mapping(source = "product.productName", target = "productName") @Mapping(source = "product.productDescription", target = "productDescription") @Mapping(source = "seller.nickname", target = "sellerNickname") + @Mapping(source = "seller.kakaoProfileImage", target = "sellerProfileImage") @Mapping(target = "images", expression = "java(filterRepresentativeImages(auction.getProduct().getImages()))") UpcomingProductDetailsDto auctionToUpcomingAuctionProductDto(Auction auction); @@ -30,6 +31,7 @@ public interface ProductMapper { @Mapping(source = "product.productName", target = "productName") @Mapping(target = "productDescription", source = "product.productDescription") @Mapping(source = "seller.nickname", target = "sellerNickname") + @Mapping(source = "seller.kakaoProfileImage", target = "sellerProfileImage") @Mapping(source = "product.images", target = "images") EndedProductDetailsDto toEndedProductDetailsDto(Auction auction); @@ -41,6 +43,7 @@ public interface ProductMapper { @Mapping(source = "auction.product.productName", target = "productName") @Mapping(source = "auction.product.productDescription", target = "productDescription") @Mapping(source = "sellerNickname", target = "sellerNickname") + @Mapping(source = "auction.seller.kakaoProfileImage", target = "sellerProfileImage") @Mapping(source = "auction.endTime", target = "endTime") @Mapping(source = "auction.numOfBidders", target = "numOfBidders") @Mapping(source = "top3BidDatePrice", target = "top3BidDatePrice")