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