Skip to content

Commit

Permalink
Merge pull request #134 from woowa-techcamp-2024/133-feature-adrank
Browse files Browse the repository at this point in the history
[feature] 광고 순 정렬
  • Loading branch information
huiseung authored Aug 26, 2024
2 parents 001b1a3 + 52af9aa commit 25adb33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package woowa.team4.bff.exposure.service;

import java.util.Comparator;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -46,6 +47,10 @@ public List<ExposureRestaurantSummary> search(SearchCommand command) {
List<ExternalApiResult> externalApiResults = getExternalResult(restaurantIds,
command.keyword())
.stream()
.sorted(
Comparator.comparing(ExternalApiResult::getAdRank)
.thenComparing(ExternalApiResult::getMin)
)
.skip(DEFAULT_PAGE_SIZE * command.pageNumber())
.limit(DEFAULT_PAGE_SIZE)
.toList();
Expand Down
1 change: 1 addition & 0 deletions service/search-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ spring:
elasticsearch:
uris: ${ELASTICSEARCH_URL}
username: ${ELASTICSEARCH_USERNAME}
password: ${ELASTICSEARCH_PASSWORD}
data:
elasticsearch:
repositories:
Expand Down

0 comments on commit 25adb33

Please sign in to comment.