Skip to content

Commit

Permalink
Merge pull request #68 from UMC-ON/feat/marketpostnscrap
Browse files Browse the repository at this point in the history
feat: 물품거래글 필터링에 거래상태 추가
  • Loading branch information
chaechaen authored Aug 21, 2024
2 parents 1cba333 + bec02df commit 55e66e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ public MarketPostResponseDTO updateMarketPostStatus(Long marketPostId, DealStatu
return mapToMarketPostResponseDTO(updatedMarketPost);
}

// 필터링: 거래형식, 국가 필터링
public List<MarketPostResponseDTO> getFilteredMarketPosts(DealType dealType, String currentCountry) {
return marketPostRepository.findFilteredMarketPosts(dealType, currentCountry, null).stream()
// 필터링: 거래형식, 국가, 거래상태 필터링
public List<MarketPostResponseDTO> getFilteredMarketPosts(DealType dealType, String currentCountry, DealStatus dealStatus) {
return marketPostRepository.findFilteredMarketPosts(dealType, currentCountry, dealStatus).stream()
.map(this::mapToMarketPostResponseDTO)
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ public ResponseEntity<Void> deleteMarketPost(@PathVariable Long userId, @PathVar
public ResponseEntity<List<MarketPostResponseDTO>> getFilteredMarketPosts(
@RequestParam(required = false) DealType dealType,
@RequestParam(required = false) String currentCountry,
@RequestParam(required = false) DealStatus dealStatus,
@AuthenticationPrincipal UserDetails userDetails) {

List<MarketPostResponseDTO> filteredPosts = marketPostService.getFilteredMarketPosts(dealType, currentCountry);
List<MarketPostResponseDTO> filteredPosts = marketPostService.getFilteredMarketPosts(dealType, currentCountry, dealStatus);
return ResponseEntity.ok(filteredPosts);
}

Expand Down

0 comments on commit 55e66e6

Please sign in to comment.