Skip to content

Commit

Permalink
develop [develop] 검색 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonjeongs committed Feb 16, 2024
1 parent a8bb63e commit 357b696
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public SearchFriendResponse searchFriend(Long userId, Pageable pageable,
final User user = userRepository.getById(userId);
final String groupName = user.getGroup().getGroupName();
List<String> uuidList = Arrays.asList(YELLO_FEMALE, YELLO_MALE);
List<User> friends = new ArrayList<>();

List<User> friendList = new ArrayList<>();

Expand All @@ -132,13 +133,12 @@ public SearchFriendResponse searchFriend(Long userId, Pageable pageable,
userRepository.findAllByGroupContainingName(groupName, keyword, uuidList));
friendList.addAll(
userRepository.findAllByOtherGroupContainingName(groupName, keyword, uuidList));

friendList.addAll(userRepository.findAllByGroupNameContainingAndFriendListNotContaining(keyword, uuidList, friendList));
} else {
friendList.addAll(
userRepository.findAllByGroupContainingYelloId(groupName, keyword, uuidList));
friendList.addAll(
userRepository.findAllByOtherGroupContainingYelloId(groupName, keyword, uuidList));
friendList.addAll(userRepository.findAllByGroupNameContainingAndFriendListNotContaining(keyword, uuidList, friendList));
}

List<SearchFriendVO> pageList = PaginationFactory.getPage(friendList, pageable)
Expand Down

0 comments on commit 357b696

Please sign in to comment.