Skip to content

[DDING-000] 통계 조회시 권한 확인 로직 추가 #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 14, 2025

Conversation

KoSeonJe
Copy link
Collaborator

@KoSeonJe KoSeonJe commented Apr 3, 2025

🚀 작업 내용

  • 동아리가 폼지의 통계 조회시 권한 체크 로직을 추가하였습니다
  • 권한 체크 로직 리팩토링 하였습니다

Summary by CodeRabbit

  • 리팩터링
    • 클럽과 양식 간의 데이터 검증 프로세스가 개선되었습니다.
    • 향상된 검증 체계를 통해 양식 통계 조회 시 클럽 정보의 일관성과 안정성이 강화되어 서비스 전반의 데이터 신뢰성이 높아졌습니다.
  • 신규 기능
    • 양식 클래스에 클럽 ID 비교를 위한 새로운 메서드가 추가되었습니다.
    • 특정 양식에 대한 권한이 없는 경우를 처리하는 새로운 예외 클래스가 도입되었습니다.

Copy link

coderabbitai bot commented Apr 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

이 변경사항은 두 주요 부분으로 나뉩니다. 첫 번째로, Form 엔티티에 isNotEqualClubId(Long clubId) 메소드가 추가되어, 관련 클럽의 아이디가 주어진 clubId와 일치하지 않는지를 안전하게 확인할 수 있도록 개선되었습니다. 두 번째로, FacadeCentralFormServiceImpl 클래스의 validateEqualsClub 메소드가 수정되어, 이전의 Objects.equals 비교 대신 새로 추가된 메소드를 호출하도록 변경되었으며, 이에 따라 관련 import 문도 제거되었습니다.

Changes

파일 경로 변경 요약
src/main/java/ddingdong/ddingdongBE/domain/form/entity/Form.java 새 메소드 isNotEqualClubId(Long clubId) 추가 (클럽 아이디 불일치 검증) 및 java.util.Objects import 추가
src/main/java/ddingdong/ddingdongBE/domain/form/service/FacadeCentralFormServiceImpl.java validateEqualsClub 메소드에서 Objects.equalsform.isNotEqualClubId(club.getId())로 대체, java.util.Objects import 제거, getStatisticsByForm에 클럽 검증 로직 추가
src/main/java/ddingdong/ddingdongBE/common/exception/FormException.java 새로운 상수 NON_HAVE_FORM_AUTHORITY_MESSAGE 추가 및 NonHaveFormAuthority 예외 클래스 추가

Sequence Diagram(s)

sequenceDiagram
    participant C as 클라이언트
    participant S as FacadeCentralFormServiceImpl
    participant F as Form 엔티티

    C->>S: getStatisticsByForm 호출
    S->>S: validateEqualsClub(club, form) 실행
    S->>F: form.isNotEqualClubId(club.getId()) 호출
    F-->>S: 불일치 여부 반환
    S->>C: 결과 반환
Loading

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07fb1d4 and 604d353.

📒 Files selected for processing (2)
  • src/main/java/ddingdong/ddingdongBE/common/exception/FormException.java (2 hunks)
  • src/main/java/ddingdong/ddingdongBE/domain/form/service/FacadeCentralFormServiceImpl.java (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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.

Copy link
Collaborator

@Seooooo24 Seooooo24 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!
충돌 나는 것 같아서 디벨롭이랑 머지만 해주시면 감사하겠습니다... ㅎㅎ

@github-actions github-actions bot added D-0 and removed D-1 labels Apr 7, 2025
Copy link
Collaborator

@5uhwann 5uhwann left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@KoSeonJe KoSeonJe merged commit 8d6f717 into develop Apr 14, 2025
1 of 2 checks passed
@KoSeonJe KoSeonJe deleted the fix/DDING-003 branch April 14, 2025 06:46
Copy link

KoSeonJe added a commit that referenced this pull request Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants