Skip to content

[Refactor] UserReader를 통한 유저 조회 통일#177

Merged
pooreumjung merged 2 commits into
developfrom
refactor/#172-user-reader-pattern
Jun 2, 2026
Merged

[Refactor] UserReader를 통한 유저 조회 통일#177
pooreumjung merged 2 commits into
developfrom
refactor/#172-user-reader-pattern

Conversation

@pooreumjung

Copy link
Copy Markdown
Member

🧾 요약

  • 여러 도메인 서비스에서 UserRepository를 직접 의존하던 유저 조회 로직을 UserReader로 통일

🔗 이슈

✨ 변경 내용

  • CommentService, PostLikeService, FreePostService, RecordPostService, HikingRecordService, TrackingSessionService, UserBlockService에서 UserRepository 의존 제거
  • 각 서비스의 중복 findUserOrThrow() 메서드 제거 및 UserReader.findActiveUserById()로 위임 통일
  • 관련 서비스 테스트에서 UserRepositoryUserReader 모킹 대상 교체

✅ 확인

  • 빌드 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: d57072e8-ce25-44f4-aad2-0e3fbd16aa3e

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/#172-user-reader-pattern

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.

@pooreumjung pooreumjung self-assigned this Jun 2, 2026
@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!

This pull request refactors the user retrieval mechanism across several domain services. By introducing and utilizing a centralized UserReader, the codebase achieves better consistency in how active users are fetched and validated, while simultaneously reducing boilerplate code in individual services.

Highlights

  • Centralized User Retrieval: Replaced direct UserRepository dependencies with UserReader.findActiveUserById() across multiple domain services to unify user lookup logic.
  • Code Cleanup: Removed redundant findUserOrThrow() private methods from various service classes, delegating the responsibility to the centralized UserReader.
  • Test Refactoring: Updated unit tests for CommentService, PostLikeService, and FreePostService to mock UserReader instead of UserRepository.
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.

@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

This pull request refactors several community services (CommentService, PostLikeService, FreePostService, and RecordPostService) and their corresponding tests to use UserReader instead of UserRepository. The review feedback suggests further optimizing database performance by utilizing ID-based repository queries (such as findByAuthor_IdAndDeletedFalse and existsByPostIdAndUserId) instead of loading full User entities when only the ID is required, in accordance with Rule 31 of the style guide.

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 5c39344 into develop Jun 2, 2026
3 checks passed
@howooyeon
howooyeon deleted the refactor/#172-user-reader-pattern 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] UserReader 패턴 통일

1 participant