Skip to content

Commit

Permalink
#39 [Update] 업장 조회(지도) 정렬 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
JSoi committed Jul 28, 2022
1 parent 8fcef0c commit 98eb22c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public StorePagedResponseDto getStoreInRange(@RequestParam(required = false) Big
@RequestParam(required = false) List<String> facility,
@PageableDefault Pageable pageable,
@AuthenticationPrincipal User user) {
return storeService.getStoreInTwoPointsRange(latStart, latEnd, lngStart, lngEnd, category, facility, pageable, user == null ? null : user.getUsername());
return storeService.getStoreInRange(latStart, latEnd, lngStart, lngEnd, category, facility, pageable, user == null ? null : user.getUsername());
}

@GetMapping("/point")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,6 @@ public Page<Store> findBetweenOnePointOrder(BigDecimal latStart,
return new PageImpl<>(storeList, pageable, fetchCount);
}

public Page<Store> findBetweenTwoPoint(BigDecimal latStart,
BigDecimal latEnd,
BigDecimal lngStart,
BigDecimal lngEnd,
String category,
List<String> facility,
Pageable pageable) {
BooleanBuilder builder = QuerydslLocation.locAndConditions(latStart, latEnd, lngStart, lngEnd, category, facility);
List<Store> storeList =
queryFactory
.selectFrom(store)
.where(builder)
.limit(pageable.getPageSize())
.offset(pageable.getOffset())
.fetch();
int fetchCount = queryFactory.selectFrom(store).where(builder).fetch().size();
return new PageImpl<>(storeList, pageable, fetchCount);
}

//TODO 별점순 - 쿼리 결과로 산출된 리스트의 평균 구하기, 정렬, 페이징
public Page<Store> findStoreOrderByPoint(BigDecimal lat,
BigDecimal lng,
Expand Down

0 comments on commit 98eb22c

Please sign in to comment.