Conversation
- nin을 partialFilter에서 지원하지않음
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning
|
| Cohort / File(s) | Summary |
|---|---|
Controller backend/src/main/java/moadong/club/controller/ClubProfileController.java |
클럽 이름으로 클럽 상세정보를 조회하는 새로운 GET 엔드포인트 /api/club/@{clubName} 추가 |
Entity & Indexing backend/src/main/java/moadong/club/entity/Club.java |
Club.name 필드에 부분 필터를 포함한 MongoDB 유니크 인덱스 추가 (uk_club_name_not_blank) |
Repository backend/src/main/java/moadong/club/repository/ClubRepository.java |
클럽 이름으로 조회하는 findClubByName() 메서드와 중복 검증을 위한 existsByNameAndIdNot() 메서드 추가 |
Service Layer backend/src/main/java/moadong/club/service/ClubProfileService.java |
클럽 이름으로 상세정보를 조회하는 getClubDetailByClubName() 메서드 추가, 클럽 이름 고유성 검증 로직(validateClubNameUnique()) 추가, DuplicateKeyException 처리 로직 추가 |
Error Handling backend/src/main/java/moadong/global/exception/ErrorCode.java |
클럽 이름 중복 오류를 나타내는 CLUB_NAME_ALREADY_EXISTS 에러 코드 상수 추가 (HTTP 409 Conflict) |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- [feature]동아리 정보 이력 저장 로직 추가 #1037: ClubProfileService 클래스에서 업데이트 후 JaVers 커밋 호출 로직을 추가하는 PR로, 동일한 서비스 계층의 변경사항입니다.
- [feature]추천 동아리를 보여주는 API 개발 #656: ClubProfileService의 클럽 상세정보 조회 로직에 추천 정보 조회 기능을 추가하는 PR로, 같은 서비스 메서드 영역을 수정합니다.
- [Release] BE v1.0.6 배포 #675: ClubDetailedResult 응답에 추천 정보를 포함하도록 변경하는 PR로, 클럽 상세정보 조회 응답 구조에 영향을 미칩니다.
Suggested labels
📬 API
Suggested reviewers
- PororoAndFriends
- Zepelown
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | PR 제목이 주요 변경사항을 명확하게 설명합니다. '동아리 한글 표시 이름 추가'는 PR에서 club name 기능을 추가하는 핵심 변경사항을 정확하게 반영합니다. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
- 📝 Generate docstrings (stacked PR)
- 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
feature/#1205-add-club-handle-MOA-655
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
Test Results99 tests 99 ✅ 19s ⏱️ Results for commit 6776fc5. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
backend/src/main/java/moadong/club/service/ClubProfileService.java (1)
88-107:getClubDetail과getClubDetailByClubName사이 중복 로직 추출 고려두 메서드 모두
Club→ClubDetailedResult.of(club)→ClubDetailedResponse변환 로직이 동일합니다. 공통 부분을 private 헬퍼 메서드로 추출하면 유지보수성이 향상됩니다.♻️ 리팩터링 제안
public ClubDetailedResponse getClubDetail(String clubId) { ObjectId objectId = ObjectIdConverter.convertString(clubId); Club club = clubRepository.findClubById(objectId) .orElseThrow(() -> new RestApiException(ErrorCode.CLUB_NOT_FOUND)); - - ClubDetailedResult clubDetailedResult = ClubDetailedResult.of( - club - ); - return new ClubDetailedResponse(clubDetailedResult); + return toDetailedResponse(club); } public ClubDetailedResponse getClubDetailByClubName(String clubName) { Club club = clubRepository.findClubByName(clubName) .orElseThrow(() -> new RestApiException(ErrorCode.CLUB_NOT_FOUND)); - - ClubDetailedResult clubDetailedResult = ClubDetailedResult.of( - club - ); - return new ClubDetailedResponse(clubDetailedResult); + return toDetailedResponse(club); } + +private ClubDetailedResponse toDetailedResponse(Club club) { + ClubDetailedResult clubDetailedResult = ClubDetailedResult.of(club); + return new ClubDetailedResponse(clubDetailedResult); +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@backend/src/main/java/moadong/club/service/ClubProfileService.java` around lines 88 - 107, Both getClubDetail and getClubDetailByClubName duplicate the conversion from Club -> ClubDetailedResult.of(club) -> new ClubDetailedResponse(...); extract that into a private helper method (e.g., private ClubDetailedResponse buildClubDetailedResponse(Club club)) inside ClubProfileService and replace the conversion in getClubDetail and getClubDetailByClubName with a call to buildClubDetailedResponse(club) so both methods delegate to the shared logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@backend/src/main/java/moadong/club/service/ClubProfileService.java`:
- Around line 88-107: Both getClubDetail and getClubDetailByClubName duplicate
the conversion from Club -> ClubDetailedResult.of(club) -> new
ClubDetailedResponse(...); extract that into a private helper method (e.g.,
private ClubDetailedResponse buildClubDetailedResponse(Club club)) inside
ClubProfileService and replace the conversion in getClubDetail and
getClubDetailByClubName with a call to buildClubDetailedResponse(club) so both
methods delegate to the shared logic.
#️⃣연관된 이슈
📝작업 내용
기존 동아리 상세 조회 엔드포인트에서 @이로 시작하는 요청일시 이름기반으로 검색합니다.
그에따라 동아리 이름의 유니크 보장이 필요해졌고 동아리 이름 중복 방지 로직이 추가되었습니다.
하다가 알게된사실은 몽고디비의 유니크 제약은
https://www.mongodb.com/ko-kr/docs/manual/core/index-unique/
인덱스로만 걸수있다~
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
릴리스 노트
새로운 기능
개선사항