Skip to content

Comments

[feature] 동아리 한글 표시 이름 추가 -BE#1206

Open
lepitaaar wants to merge 5 commits intodevelop/befrom
feature/#1205-add-club-handle-MOA-655
Open

[feature] 동아리 한글 표시 이름 추가 -BE#1206
lepitaaar wants to merge 5 commits intodevelop/befrom
feature/#1205-add-club-handle-MOA-655

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Feb 16, 2026

#️⃣연관된 이슈

📝작업 내용

기존 동아리 상세 조회 엔드포인트에서 @이로 시작하는 요청일시 이름기반으로 검색합니다.
그에따라 동아리 이름의 유니크 보장이 필요해졌고 동아리 이름 중복 방지 로직이 추가되었습니다.

하다가 알게된사실은 몽고디비의 유니크 제약은
https://www.mongodb.com/ko-kr/docs/manual/core/index-unique/
인덱스로만 걸수있다~

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 동아리 이름으로 동아리 상세 정보를 조회할 수 있는 기능 추가
  • 개선사항

    • 동아리 이름 중복 검증 로직 강화
    • 동아리 정보 업데이트 시 이름 중복 감지 및 처리 개선
    • 데이터베이스에 이름 고유성 제약 조건 추가

@lepitaaar lepitaaar self-assigned this Feb 16, 2026
@lepitaaar lepitaaar added ✨ Feature 기능 개발 💾 BE Backend labels Feb 16, 2026
@vercel
Copy link

vercel bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moadong Ready Ready Preview, Comment Feb 23, 2026 5:50am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

클럽 이름으로 클럽 상세정보를 조회하는 API 엔드포인트를 추가하고, 클럽 이름의 고유성 검증 로직을 구현하며, Club.name 필드에 유니크 인덱스를 적용했습니다.

Changes

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

Suggested labels

📬 API

Suggested reviewers

  • PororoAndFriends
  • Zepelown
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Test Results

99 tests   99 ✅  19s ⏱️
23 suites   0 💤
23 files     0 ❌

Results for commit 6776fc5.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
backend/src/main/java/moadong/club/service/ClubProfileService.java (1)

88-107: getClubDetailgetClubDetailByClubName 사이 중복 로직 추출 고려

두 메서드 모두 ClubClubDetailedResult.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.

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

Labels

💾 BE Backend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant