Skip to content

[Feat] 친구 목록, 친구 프로필, 친구의 우리동네 추천 코스 조회 API 구현 - #438

Open
chans20 wants to merge 3 commits into
developfrom
feat/433-friend-list
Open

chans20 wants to merge 3 commits into
developfrom
feat/433-friend-list

Conversation

@chans20

@chans20 chans20 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

📌 PR 설명

  • 친구 목록 조회 GET /api/v1/friends (이름순 커서 페이징, 이름 부분 일치, 친구코드 앞부분 일치 검색)
  • 친구 프로필 조회 GET /api/v1/friends/{friendUserId}
  • 친구의 우리동네 추천 코스 조회 GET /api/v1/friends/{friendUserId}/courses/local (CoursePreview 형식)
  • 친구가 아니거나 탈퇴, 비활성 사용자면 FRIEND4043을 반환합니다.

🔗 연관된 이슈

Resolves: #433

📝 리뷰 요구사항

  • course 도메인 코드는 수정하지 않고, 친구 도메인에 FriendCourseRepository를 추가했습니다. CourseHashtagRepository, CourseLikeRepository, CoursePreview를 재사용합니다.
  • canManage는 조회자가 ADMIN일 때만 true입니다. CourseServiceImpl의 규칙과 같은 결과가 되도록 친구 도메인에 따로 구현했습니다.

💻 테스트 결과

  • API 테스트 완료
  • 정상 동작 확인
스크린샷 2026-11-03 011704 스크린샷 2026-11-03 011840

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added searchable, cursor-paginated friend lists.
    • Added friend profile details and paginated previews of friends’ local courses, including course images, tags, and like status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chans20 chans20 self-assigned this Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Adds authenticated APIs to search accepted friends, retrieve a friend profile, and retrieve a friend’s local-course previews. The APIs use cursor pagination, friend-access checks, and course preview enrichment.

Changes: Friend APIs

Layer / File(s) Summary
Friend search and pagination
src/main/java/com/yeogido/backend/domain/friend/controller/FriendController.java, src/main/java/com/yeogido/backend/domain/friend/service/FriendService.java, src/main/java/com/yeogido/backend/domain/friend/service/FriendServiceImpl.java, src/main/java/com/yeogido/backend/domain/friend/repository/FriendshipRepository.java, src/test/java/com/yeogido/backend/domain/friend/repository/FriendshipRepositoryTest.java, src/test/java/com/yeogido/backend/domain/friend/service/FriendServiceImplTest.java
Adds GET /api/v1/friends with nickname and friend-code search, paired nickname/ID cursors, and page-size validation. Repository and service tests cover ordering, filters, and cursor behavior.
Friend profile and access checks
src/main/java/com/yeogido/backend/domain/friend/controller/FriendController.java, src/main/java/com/yeogido/backend/domain/friend/dto/FriendResDTO.java, src/main/java/com/yeogido/backend/domain/friend/converter/FriendConverter.java, src/main/java/com/yeogido/backend/domain/friend/service/FriendServiceImpl.java, src/test/java/com/yeogido/backend/domain/friend/service/FriendServiceImplTest.java
Adds GET /api/v1/friends/{friendUserId} and a profile response containing user and region details. Profile retrieval rejects self, non-friends, and inactive friends.
Friend local-course previews
src/main/java/com/yeogido/backend/domain/friend/controller/FriendController.java, src/main/java/com/yeogido/backend/domain/friend/service/FriendService.java, src/main/java/com/yeogido/backend/domain/friend/service/FriendServiceImpl.java, src/main/java/com/yeogido/backend/domain/friend/repository/FriendCourseRepository.java, src/main/java/com/yeogido/backend/domain/friend/converter/FriendConverter.java, src/test/java/com/yeogido/backend/domain/friend/repository/FriendCourseRepositoryTest.java, src/test/java/com/yeogido/backend/domain/friend/service/FriendServiceImplTest.java
Adds GET /api/v1/friends/{friendUserId}/courses/local. Results include undeleted local courses in descending ID order, with image URLs, hashtags, like status, and an admin-only management flag.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant FriendController
  participant FriendServiceImpl
  participant FriendCourseRepository
  participant CourseHashtagRepository
  participant CourseLikeRepository
  Client->>FriendController: Request a friend's local courses
  FriendController->>FriendServiceImpl: Get cursor-paginated course previews
  FriendServiceImpl->>FriendCourseRepository: Fetch local courses with size plus one
  FriendServiceImpl->>CourseHashtagRepository: Fetch hashtags for course IDs
  FriendServiceImpl->>CourseLikeRepository: Fetch the requester's liked course IDs
  FriendServiceImpl-->>FriendController: Return previews and cursor data
  FriendController-->>Client: Return successful API response
Loading

Possibly related PRs

  • yeogido/backend#424: Adds the accepted-friendship relationship used for friend listing and friend-access checks.
  • yeogido/backend#417: Adds the friend-code data used by friend-list prefix search.

Suggested reviewers: yangjiae12, seoyeon-park0103

Merge Risk: Minimal · up to e2def

The reviewed friend search and local-course selection paths show no identified issue requiring a fix before merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "[Feat] 친구 목록, 친구 프로필, 친구의 우리동네 추천 코스 조회 API 구현" states the main change: the PR implements three friend-domain read APIs (friend list, friend profile, and a friend's local recommended course…
Description check Passed The description follows the repository template. It includes the 'PR 설명' section with the three endpoints and the FRIEND4043 error behavior, the '연관된 이슈' section linking Resolves: #433, the '리뷰 요구사항' …
Linked Issues check Passed Issue #433 coding requirements are satisfied. The PR adds the friend list endpoint with name and friend-code search and name/ID cursor pagination. It adds friend profile fields for nickname, profile i…
Out of Scope Changes check Passed The production changes and tests support issue #433. They implement friend list, friend profile, and friend local-course retrieval, including supporting repositories, conversion, access checks, and au…
Full details: Title check

Explanation

The title "[Feat] 친구 목록, 친구 프로필, 친구의 우리동네 추천 코스 조회 API 구현" states the main change: the PR implements three friend-domain read APIs (friend list, friend profile, and a friend's local recommended courses). The raw summary and objectives confirm the controller, service, repository, and test changes match these three APIs. The title is specific, uses the repository's [Feat] prefix, and is a single phrase.

Full details: Description check

Explanation

The description follows the repository template. It includes the 'PR 설명' section with the three endpoints and the FRIEND4043 error behavior, the '연관된 이슈' section linking Resolves: #433, the '리뷰 요구사항' section with notes on the FriendCourseRepository design and the canManage rule, and the '테스트 결과' section with both checkboxes marked and two screenshots. The description is complete and specific. Minor note: the template placeholder '- ' bullets were replaced with real content, which is expected.

Full details: Linked Issues check

Explanation

Issue #433 coding requirements are satisfied. The PR adds the friend list endpoint with name and friend-code search and name/ID cursor pagination. It adds friend profile fields for nickname, profile image, email, and region. It adds local-course retrieval with CourseType.LOCAL, descending course ID pagination, and CoursePreview data. Friend access validation returns FRIEND4043 for non-friends or inactive users. Repository and service tests cover the required behavior.

Full details: Out of Scope Changes check

Explanation

The production changes and tests support issue #433. They implement friend list, friend profile, and friend local-course retrieval, including supporting repositories, conversion, access checks, and automated tests. The supplied whole-PR summary shows no friend travel-map or unrelated feature changes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 10 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6f4cef3-e74f-4900-8e95-b3154f926e16
Commits

Reviewing files that changed from the base of the PR and between 00d1119 and e2defec.

Files selected for processing: 7
  • src/main/java/com/yeogido/backend/domain/friend/controller/FriendController.java
  • src/main/java/com/yeogido/backend/domain/friend/converter/FriendConverter.java
  • src/main/java/com/yeogido/backend/domain/friend/dto/FriendResDTO.java
  • src/main/java/com/yeogido/backend/domain/friend/repository/FriendshipRepository.java
  • src/main/java/com/yeogido/backend/domain/friend/service/FriendServiceImpl.java
  • src/test/java/com/yeogido/backend/domain/friend/repository/FriendshipRepositoryTest.java
  • src/test/java/com/yeogido/backend/domain/friend/service/FriendServiceImplTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@chans20

chans20 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 친구 목록, 친구 프로필, 친구의 우리동네 추천 코스 조회 API 구현

1 participant