Skip to content

Comments

[refactor] Club 조회 및 검색 로직에 예외 처리#331

Merged
Zepelown merged 7 commits intodevelop/befrom
refactor/#330/club-error-exception
May 1, 2025
Merged

[refactor] Club 조회 및 검색 로직에 예외 처리#331
Zepelown merged 7 commits intodevelop/befrom
refactor/#330/club-error-exception

Conversation

@Zepelown
Copy link
Member

@Zepelown Zepelown commented Apr 24, 2025

#️⃣연관된 이슈

#330

📝작업 내용

  • getClubDetail 메서드에 예외 처리 개선
  • ClubCategory fromString 메서드 RecruitmentStatus와의 일관성 유지
  • 검색 시 예외 처리
  • 사용자 권한 검증 로직 리팩토링
    • 모집 정보 및 약력 수정 시에 자기가 소유하고 있는 클럽만 수정할 수 있도록 변경
  • 모집 정보 수정 관련 변수 및 함수명이 모호한 점을 변경
    • ClubDescription -> ClubRecruitmentInfo
  • ObjectId 검증 로직 분리

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

변경 사항이 꽤 많으니 자세히 봐주셨으면 좋겠습니다.

@Zepelown Zepelown added 📬 API 서버 API 통신 작업 🔨 Refactor 코드 리팩토링 💾 BE Backend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 labels Apr 24, 2025
@Zepelown Zepelown self-assigned this Apr 24, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Apr 24, 2025

Test Results

1 tests   1 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 802de75.

♻️ This comment has been updated with latest results.

objectId = new ObjectId(clubId);
} catch (IllegalArgumentException e){
throw new RestApiException(ErrorCode.CLUB_ID_INVALID);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

ObjectId 예외처리하는 부분이 이곳 말고도 있는걸로 아는데 메서드로 추출해서 처리하는건 어떨까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

좋습니다. 수정해보도록 하겠습니다.

Copy link
Collaborator

@PororoAndFriends PororoAndFriends left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Copy link
Collaborator

@Due-IT Due-IT left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 :)

@SecurityRequirement(name = "BearerAuth")
public ResponseEntity<?> createClub(@CurrentUser CustomUserDetails user,
@RequestBody ClubCreateRequest request) {
public ResponseEntity<?> createClub(@RequestBody ClubCreateRequest request) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

createClub에는 @currentuser가 제거되고 updateClubInfo에는 추가된 이유가 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

createClub에서 user를 사용할 필요가 없다고 생각해서 제거했습니다. 클럽을 만들 때, 지금 접속한 유저의 정보는 필요하지 않기 때문입니다.
updateClubInfo에 생긴 이유는 자기가 소유한 클럽만 update할 수 있도록 제한을 두었습니다.

@Zepelown Zepelown merged commit 829ae77 into develop/be May 1, 2025
3 checks passed
@Zepelown Zepelown deleted the refactor/#330/club-error-exception branch May 3, 2025 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📬 API 서버 API 통신 작업 💾 BE Backend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants