From bec02df9940146dbb8a660072d7730b125ad1b0d Mon Sep 17 00:00:00 2001 From: chaechaen Date: Wed, 21 Aug 2024 16:44:49 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=AC=BC=ED=92=88=EA=B1=B0=EB=9E=98?= =?UTF-8?q?=EA=B8=80=20=ED=95=84=ED=84=B0=EB=A7=81=EC=97=90=20=EA=B1=B0?= =?UTF-8?q?=EB=9E=98=EC=83=81=ED=83=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/marketPost/application/MarketPostService.java | 6 +++--- .../marketPost/presentation/MarketPostController.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/on/server/domain/marketPost/application/MarketPostService.java b/src/main/java/com/on/server/domain/marketPost/application/MarketPostService.java index db662814..76df891a 100644 --- a/src/main/java/com/on/server/domain/marketPost/application/MarketPostService.java +++ b/src/main/java/com/on/server/domain/marketPost/application/MarketPostService.java @@ -121,9 +121,9 @@ public MarketPostResponseDTO updateMarketPostStatus(Long marketPostId, DealStatu return mapToMarketPostResponseDTO(updatedMarketPost); } - // 필터링: 거래형식, 국가 필터링 - public List getFilteredMarketPosts(DealType dealType, String currentCountry) { - return marketPostRepository.findFilteredMarketPosts(dealType, currentCountry, null).stream() + // 필터링: 거래형식, 국가, 거래상태 필터링 + public List getFilteredMarketPosts(DealType dealType, String currentCountry, DealStatus dealStatus) { + return marketPostRepository.findFilteredMarketPosts(dealType, currentCountry, dealStatus).stream() .map(this::mapToMarketPostResponseDTO) .collect(Collectors.toList()); } diff --git a/src/main/java/com/on/server/domain/marketPost/presentation/MarketPostController.java b/src/main/java/com/on/server/domain/marketPost/presentation/MarketPostController.java index a1b317b9..69104216 100644 --- a/src/main/java/com/on/server/domain/marketPost/presentation/MarketPostController.java +++ b/src/main/java/com/on/server/domain/marketPost/presentation/MarketPostController.java @@ -89,9 +89,10 @@ public ResponseEntity deleteMarketPost(@PathVariable Long userId, @PathVar public ResponseEntity> getFilteredMarketPosts( @RequestParam(required = false) DealType dealType, @RequestParam(required = false) String currentCountry, + @RequestParam(required = false) DealStatus dealStatus, @AuthenticationPrincipal UserDetails userDetails) { - List filteredPosts = marketPostService.getFilteredMarketPosts(dealType, currentCountry); + List filteredPosts = marketPostService.getFilteredMarketPosts(dealType, currentCountry, dealStatus); return ResponseEntity.ok(filteredPosts); }