feature: 팔로우/팔로잉 관계 구현 - #49
Merged
Merged
Conversation
- User에 고유 username 필드 추가 (인스타그램 아이디, 영문/숫자/_, 3~30자, 중복 불가) - Follow 엔티티 및 PENDING/ACCEPTED 상태 기반 팔로우 신청·수락·거절 플로우 구현 - 팔로우 신청/취소/언팔로우, 받은 신청 목록, 팔로워·팔로잉 목록 API 추가 - username·닉네임 기반 유저 검색 API 추가 (GET /users/search) - 다른 유저 공개 프로필 조회 API 추가 (팔로워·팔로잉 수, 나와의 관계 포함) - 피드 공개 범위(FOLLOWERS_ONLY) 실제 필터링 적용 (기존 버그 수정) 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.
📌 작업 내용
인스타그램 스타일의 팔로우/팔로잉 관계 시스템을 구현했습니다.
✅ 구현 사항
1. 계정 고유 아이디 (
username)users테이블에username컬럼 추가 (영문·숫자·언더스코어, 3~30자, 중복 불가)POST·PATCH /users/me)에username파라미터 추가2. 팔로우 신청 / 수락 / 거절 플로우
follows테이블 신규 생성 (PENDING→ACCEPTED상태 전환)POST /api/v1/follows/{targetUserId}— 팔로우 신청DELETE /api/v1/follows/{targetUserId}— 신청 취소 / 언팔로우PATCH /api/v1/follows/requests/{followId}/accept— 수락DELETE /api/v1/follows/requests/{followId}/reject— 거절GET /api/v1/follows/requests— 받은 팔로우 신청 목록3. 팔로워 / 팔로잉 목록
GET /api/v1/follows/followers— 내 팔로워 목록GET /api/v1/follows/followings— 내 팔로잉 목록GET /api/v1/follows/{userId}/followers— 특정 유저 팔로워 목록GET /api/v1/follows/{userId}/followings— 특정 유저 팔로잉 목록4. 유저 검색
GET /api/v1/users/search?keyword=xxx— username·닉네임 동시 검색 (최대 20명)null/PENDING/ACCEPTED) 포함5. 다른 유저 공개 프로필 조회
GET /api/v1/users/{userId}— 팔로워·팔로잉 수 + 나와의 관계 + 본인 여부 포함6. 피드 공개 범위 필터링 버그 수정
FOLLOWERS_ONLY설정이 DB에만 저장되고 실제 필터링 없음📂 변경 파일
domain/Follow.java,domain/FollowStatus.javarepository/FollowRepository.javaservice/FollowService.javacontroller/FollowController.javadto/FollowUserDto,FollowRequestItemDto,UserSearchResponseDto,UserPublicProfileResponseDtodomain/User.java— username 필드 추가repository/UserRepository.java,FeedRepository.javaservice/UserService.java,FeedService.javacontroller/UserController.java🗄️ DB 변경사항
Hibernate
ddl-auto=update로 배포 시 자동 반영됩니다.users.username컬럼 추가 (VARCHAR 30, UNIQUE)follows테이블 신규 생성🤖 Generated with Claude Code