Skip to content

Commit

Permalink
fix #96 - order by score
Browse files Browse the repository at this point in the history
order by score desc
  • Loading branch information
cheesecrust committed May 13, 2024
1 parent 79dea52 commit 6601da9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public record SearchFilterRequest(
Boolean hasAirConditioner,
Boolean hasRefrigerator,
Boolean hasWasher,
Boolean hasTerrace
Boolean hasTerrace,
Boolean cardOption
) {

public static SearchFilterRequest fromJson(String json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

public interface RecommendRepository extends JpaRepository<Recommend, Long> {

List<Recommend> findAllByUserIdAndCardType(String userId, String cardType);
List<Recommend> findAllByUserIdAndCardTypeOrderByScoreDesc(String userId, String cardType);

}
3 changes: 2 additions & 1 deletion src/main/java/org/capstone/maru/service/ProfileService.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public List<SimpleMemberProfileResponse> searchContainByEmail(String word) {
@Transactional(readOnly = true)
public List<SimpleMemberCardDto> getRecommendMember(String memberId, String cardType) {

List<Recommend> recommendList = recommendRepository.findAllByUserIdAndCardType(memberId,
List<Recommend> recommendList = recommendRepository.findAllByUserIdAndCardTypeOrderByScoreDesc(
memberId,
cardType);

return recommendList.stream().map(recommend -> {
Expand Down

0 comments on commit 6601da9

Please sign in to comment.