Skip to content

[Refactor] 소유권 검증을 엔티티 메서드로 통일#178

Merged
pooreumjung merged 2 commits into
developfrom
refactor/#173-owned-by-method
Jun 2, 2026
Merged

[Refactor] 소유권 검증을 엔티티 메서드로 통일#178
pooreumjung merged 2 commits into
developfrom
refactor/#173-owned-by-method

Conversation

@pooreumjung

Copy link
Copy Markdown
Member

🧾 요약

  • 서비스 전반에 흩어진 소유권 체크 패턴을 엔티티 메서드 isOwnedBy()로 통일

🔗 이슈

✨ 변경 내용

  • PostisOwnedBy(Long userId) 메서드 추가 — FreePost, RecordPost 공통 소유권 판단
  • CommentisOwnedBy(Long userId) 메서드 추가
  • FreePostService, RecordPostService, CommentService, FreePostReportService 소유권 체크 블록 교체
  • 소유권 검증 delete 단위 테스트 추가 (FreePostService, RecordPostService, CommentService)

✅ 확인

  • 빌드 OK
  • 테스트 OK

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 89378d84-4fe0-4b1b-9406-0d5cf03d7f75

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#173-owned-by-method

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

본 PR은 서비스 내 여러 곳에서 중복으로 사용되던 소유권 검증 로직을 엔티티 내부 메서드로 캡슐화하여 코드의 응집도를 높이고 유지보수성을 개선하는 것을 목적으로 합니다. 엔티티 수준에서 소유권을 판단하도록 변경함으로써 비즈니스 로직의 일관성을 확보하였습니다.

Highlights

  • 엔티티 메서드 통합: Post와 Comment 엔티티에 isOwnedBy(Long userId) 메서드를 추가하여 서비스 전반에 흩어져 있던 소유권 검증 로직을 통일했습니다.
  • 서비스 로직 리팩토링: FreePostService, RecordPostService, CommentService, FreePostReportService에서 직접 수행하던 소유권 체크를 엔티티 메서드 호출 방식으로 변경했습니다.
  • 테스트 코드 보강: 소유권 검증 로직에 대한 삭제 단위 테스트를 추가하고, RecordPostServiceTest를 신규 작성하여 안정성을 확보했습니다.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pooreumjung pooreumjung self-assigned this Jun 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

본 풀 리퀘스트는 Comment 및 Post 엔티티에 소유권 확인을 위한 isOwnedBy 메서드를 추가하고, 관련 서비스 클래스들에서 기존의 작성자 ID 직접 비교 로직을 해당 메서드 호출로 대체하여 객체지향적인 캡슐화를 강화하였습니다. 또한, 이에 맞춰 CommentServiceTest, FreePostServiceTest에 테스트 케이스를 추가하고 RecordPostServiceTest를 신규 작성하여 비즈니스 로직의 검증을 보완하였습니다. 변경 사항이 깔끔하게 반영되었으며, 제공할 추가 피드백은 없습니다.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@pooreumjung
pooreumjung merged commit 074e711 into develop Jun 2, 2026
3 checks passed
@howooyeon
howooyeon deleted the refactor/#173-owned-by-method branch June 5, 2026 12:29
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.

[refactor] 소유권 체크 isOwnedBy() 메서드화

1 participant