feat: 팔로우 API 개선 - followsMeBack 필드 추가 및 팔로워/팔로잉 목록 커서 페이지네이션 - #53
Merged
Conversation
- UserPublicProfileResponseDto에 followsMeBack(boolean) 필드 추가
- 상대가 나를 팔로우(ACCEPTED)하는지 여부를 서버에서 직접 계산해 내려줌
- 클라이언트에서 전체 팔로워 리스트를 받아 메모리에서 탐색하던 방식 제거
- GET /api/v1/follows/followers|followings, /{userId}/followers|followings 4개 엔드포인트에 커서 페이지네이션 적용
- ?cursor=<lastFollowId>&limit=20 쿼리 파라미터
- 응답: { items, nextCursor, hasMore }
- followId 기준 내림차순(DESC), limit+1 조회로 hasMore 판별
- CursorPageResponse<T> 공용 DTO 신규 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/v1/users/{userId}응답에followsMeBack필드 추가 — 상대가 나를 팔로우하는지 여부를 서버에서 계산?cursor=<lastFollowId>&limit=20)CursorPageResponse<T>DTO 신규 추가Changed Files
UserPublicProfileResponseDtofollowsMeBack: boolean필드 추가FollowServicegetPublicProfile()— 역방향 팔로우 조회 추가;getFollowers/getFollowings— 커서 페이지네이션으로 교체FollowRepositoryfindFollowersCursor,findFollowingsCursor쿼리 추가FollowControllercursor,limit쿼리 파라미터 추가CursorPageResponse<T>items,nextCursor,hasMoreAPI Spec Changes
①
GET /api/v1/users/{userId}응답 필드 추가{ "followsMeBack": true }true: 상대가 나를 팔로우(ACCEPTED) 중false② 팔로워/팔로잉 목록 4개 엔드포인트 페이지네이션
cursor없으면 첫 페이지 (Long.MAX_VALUE 대체)limit기본값 20{ "items": [ { "followId": 456, "userId": 12, "username": "hong", "nickname": "홍길동", "profileImageUrl": "..." } ], "nextCursor": "455", "hasMore": true }hasMore: false/nextCursor: null이면 마지막 페이지Test Plan
GET /api/v1/users/{userId}— 맞팔 유저 조회 시followsMeBack: true확인GET /api/v1/users/{userId}— 단방향 팔로우 / 비로그인 시followsMeBack: false확인cursor없음) 정상 반환 확인nextCursor로 다음 페이지 연속 조회 확인hasMore: false시 마지막 페이지 처리 확인🤖 Generated with Claude Code