Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
junseokkim committed Jan 2, 2024
2 parents 279a8b6 + 13aa08d commit b2066bb
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.teami.domain.friend.entity.Friend;
import com.teami.domain.friend.repository.FriendRepository;
import com.teami.domain.member.entitty.Member;
import com.teami.domain.member.repository.MemberRepository;
import com.teami.domain.member.service.MemberService;
import com.teami.global.apiPayload.ExceptionHandler;
import com.teami.global.apiPayload.code.status.ErrorStatus;
Expand All @@ -29,6 +30,7 @@ public class FriendService {
private final FriendRepository friendRepository;
private final MemberService memberService;
private final CalendarRepository calendarRepository;
private final MemberRepository memberRepository;
private final CalendarMissionRepository calendarMissionRepository;

@Transactional
Expand Down Expand Up @@ -77,7 +79,14 @@ public void deleteFriend(Long requesterId, Long requestedId) {
friend.markAsDeleted();
}

private void validateMember(Long memberId) {
if (!memberRepository.existsById(memberId)) {
throw new ExceptionHandler(ErrorStatus.MEMBER_NOT_FOUND);
}
}

public FriendListResponse getFriendList(Long memberId) {
validateMember(memberId);
return new FriendListResponse(memberId, findFriendsIdByMemberId(memberId));
}

Expand Down

0 comments on commit b2066bb

Please sign in to comment.