diff --git a/src/main/java/me/snaptime/friend/service/FriendService.java b/src/main/java/me/snaptime/friend/service/FriendService.java index 56a36beb..b3b89c54 100644 --- a/src/main/java/me/snaptime/friend/service/FriendService.java +++ b/src/main/java/me/snaptime/friend/service/FriendService.java @@ -25,5 +25,10 @@ FindFriendResDto findFriendList(String loginId, String targetLoginId, Long pageN // 유저 프로필 조회 시 팔로잉,팔로워 수를 반환하는 메소드 FriendCntResDto findFriendCnt(String loginId); + /* + reqUser가 targetUser를 팔로우했는 지 여부 반환 + */ + boolean checkIsFollow(User reqUser, User targetUser); + } diff --git a/src/main/java/me/snaptime/friend/service/impl/FriendServiceImpl.java b/src/main/java/me/snaptime/friend/service/impl/FriendServiceImpl.java index 4e44fea6..fce0c3be 100644 --- a/src/main/java/me/snaptime/friend/service/impl/FriendServiceImpl.java +++ b/src/main/java/me/snaptime/friend/service/impl/FriendServiceImpl.java @@ -110,7 +110,7 @@ public FindFriendResDto findFriendList(String reqLoginId, String targetLoginId, List friendInfoList = result.stream().map(entity -> { - boolean isMyFriend = checkIsFriend(reqUser ,findUserByLoginId(entity.get(user.loginId))); + boolean isMyFriend = checkIsFollow(reqUser ,findUserByLoginId(entity.get(user.loginId))); String profilePhotoURL = urlComponent.makeProfileURL(entity.get(user.profilePhoto.id)); return FriendInfo.toDto(entity,profilePhotoURL,isMyFriend); }).collect(Collectors.toList()); @@ -130,8 +130,8 @@ public FriendCntResDto findFriendCnt(String loginId){ return FriendCntResDto.toDto(followerCnt,followingCnt); } - // 자신이 해당유저를 팔로우했는 지 유무 반환 - private boolean checkIsFriend(User reqUser, User targetUser){ + @Override + public boolean checkIsFollow(User reqUser, User targetUser){ return friendRepository.existsBySenderAndReceiver(reqUser, targetUser); }