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(); } 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(