From 80a3b91c242b1e882b9321ba26409b9ca65a91b8 Mon Sep 17 00:00:00 2001 From: leeinhong95 Date: Fri, 24 May 2024 15:59:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20ProgressItemsDto=20-=20?= =?UTF-8?q?=ED=98=84=EC=9E=AC=EA=B0=80=EA=B2=A9=20=EC=B4=88=EA=B8=B0?= =?UTF-8?q?=ED=99=94=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kcs3/panda/domain/auction/dto/ProgressItemsDto.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kcs3/panda/domain/auction/dto/ProgressItemsDto.java b/src/main/java/com/kcs3/panda/domain/auction/dto/ProgressItemsDto.java index ef74a3a..3cd8519 100644 --- a/src/main/java/com/kcs3/panda/domain/auction/dto/ProgressItemsDto.java +++ b/src/main/java/com/kcs3/panda/domain/auction/dto/ProgressItemsDto.java @@ -16,6 +16,7 @@ public record ProgressItemsDto( String thumbnail, int startPrice, int currentPrice, + int buyNowPrice, boolean isAuctionComplete ) { public static ProgressItemsDto fromProgressEntity(AuctionProgressItem progressItem) { @@ -26,7 +27,8 @@ public static ProgressItemsDto fromProgressEntity(AuctionProgressItem progressIt .tradingMethod(progressItem.getItem().getTradingMethod().getTradingMethod()) .thumbnail(progressItem.getThumbnail()) .startPrice(progressItem.getStartPrice()) - .currentPrice(progressItem.getMaxPrice()) + .currentPrice((progressItem.getMaxPersonNickName() != null)?progressItem.getMaxPrice():0) + .buyNowPrice(progressItem.getBuyNowPrice()) .isAuctionComplete(progressItem.getItem().isAuctionComplete()) .build(); } @@ -39,7 +41,8 @@ public static ProgressItemsDto fromCompletionEntity(AuctionCompleteItem complete .tradingMethod(completeItem.getItem().getTradingMethod().getTradingMethod()) .thumbnail(completeItem.getThumbnail()) .startPrice(completeItem.getStartPrice()) - .currentPrice(completeItem.getMaxPrice()) + .currentPrice((completeItem.getMaxPersonNickName() != null)?completeItem.getMaxPrice():0) + .buyNowPrice(completeItem.getBuyNowPrice()) .isAuctionComplete(completeItem.getItem().isAuctionComplete()) .build(); } From aadb6d833cd88f69886e8cf942dbf1fe502a8103 Mon Sep 17 00:00:00 2001 From: leeinhong95 Date: Fri, 24 May 2024 16:24:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20ItemRepository=20-=20=EA=B1=B0?= =?UTF-8?q?=EB=9E=98=EB=B0=A9=EB=B2=95=20=ED=8A=B9=EC=A0=95=EB=B0=A9?= =?UTF-8?q?=EB=B2=95=20=EB=B0=8F=20=EC=A0=84=EC=B2=B4=20=EA=B0=99=EC=9D=B4?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=EB=90=98=EB=8A=94=20=EB=A1=9C=EC=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kcs3/panda/domain/auction/repository/ItemRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kcs3/panda/domain/auction/repository/ItemRepository.java b/src/main/java/com/kcs3/panda/domain/auction/repository/ItemRepository.java index 671ccbb..1dfcbb5 100644 --- a/src/main/java/com/kcs3/panda/domain/auction/repository/ItemRepository.java +++ b/src/main/java/com/kcs3/panda/domain/auction/repository/ItemRepository.java @@ -30,7 +30,7 @@ public interface ItemRepository extends JpaRepository { "JOIN FETCH item.tradingMethod method " + "JOIN FETCH item.region region " + "WHERE (:category IS NULL OR category.category = :category) " + - "AND (:method IS NULL OR method.tradingMethod = :method) " + + "AND (:method IS NULL OR method.tradingMethod = :method OR method.tradingMethod = 3) " + "AND (:region IS NULL OR region.region = :region) " + "ORDER BY item.itemId DESC") Slice findByProgressItemWithLocationAndMethodAndRegion( @@ -55,7 +55,7 @@ Slice findByProgressItemWithLocationAndMethodAndRegion( "JOIN FETCH item.tradingMethod method " + "JOIN FETCH item.region region " + "WHERE (:category IS NULL OR category.category = :category) " + - "AND (:method IS NULL OR method.tradingMethod = :method) " + + "AND (:method IS NULL OR method.tradingMethod = :method OR method.tradingMethod = 3) " + "AND (:region IS NULL OR region.region = :region) " + "ORDER BY item.itemId DESC") Slice findByCompleteItemWithLocationAndMethodAndRegion(