From 214de7537cd6ab1b01a4f62d5fdad284246f0e3e Mon Sep 17 00:00:00 2001 From: choi inho <129029251+inhooo00@users.noreply.github.com> Date: Thu, 28 Nov 2024 22:12:21 +0900 Subject: [PATCH] =?UTF-8?q?Feat(#197):=20=EC=B6=94=EC=B2=9C=EC=B9=9C?= =?UTF-8?q?=EA=B5=AC=20=EC=9D=B4=EB=AF=B8=20=EC=B9=9C=EA=B5=AC=EC=9D=BC=20?= =?UTF-8?q?=EB=95=8C=20=EC=95=88=20=EB=82=98=EC=98=A4=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/repository/FollowCustomRepositoryImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/shop/kkeujeok/kkeujeokbackend/member/follow/domain/repository/FollowCustomRepositoryImpl.java b/src/main/java/shop/kkeujeok/kkeujeokbackend/member/follow/domain/repository/FollowCustomRepositoryImpl.java index 97aabbc..a040b12 100644 --- a/src/main/java/shop/kkeujeok/kkeujeokbackend/member/follow/domain/repository/FollowCustomRepositoryImpl.java +++ b/src/main/java/shop/kkeujeok/kkeujeokbackend/member/follow/domain/repository/FollowCustomRepositoryImpl.java @@ -134,11 +134,9 @@ public Page findRecommendedFollowList(Long memberId potentialFriends = potentialFriends.stream().distinct().collect(Collectors.toList()); - // 친구 관계 여부 확인을 위한 로직 추가 List recommendedFollows = potentialFriends.stream() .filter(teamMember -> !teamMember.getId().equals(memberId)) // 본인 제외 - .map(teamMember -> { - // 현재 추천 대상 사용자가 팔로우 관계인지 확인 + .filter(teamMember -> { boolean isFollow = queryFactory .selectOne() .from(follow) @@ -148,9 +146,9 @@ public Page findRecommendedFollowList(Long memberId .and(follow.toMember.id.eq(memberId))) ) .fetchFirst() != null; - - return RecommendedFollowInfoResDto.from(teamMember, isFollow); + return !isFollow; }) + .map(teamMember -> RecommendedFollowInfoResDto.from(teamMember, false)) .collect(Collectors.toList()); int start = (int) pageable.getOffset();