Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe changes add support for fetching and processing Kakao service terms to determine user marketing agreement status during OAuth login. They extend the OAuthUserInfo record, modify user creation to reflect marketing agreement and default gender, update OAuth2 authorization request handling to include service terms, adjust Kakao OAuth scopes, and remove an obsolete OAuth2 authorization request resolver configuration. Minor database initialization and user response formatting adjustments are also included. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant OAuthUserService
participant KakaoAPI
participant UserRepository
Client->>OAuthUserService: OAuth2 login request with access token
OAuthUserService->>KakaoAPI: Fetch service terms with access token
KakaoAPI-->>OAuthUserService: Return service terms JSON
OAuthUserService->>UserRepository: Find or create user with marketing agreement and gender info
UserRepository-->>OAuthUserService: Return user entity
OAuthUserService-->>Client: Return authenticated user info with marketing agreement status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (6)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Summary of Changes
Hello @wlgns12370, 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!
I've made several refactoring changes to improve data handling and initialization. The primary goal was to enhance the display of gender information by localizing the Gender Enum output to Korean. Additionally, I've updated an exam date within the database initializer and adjusted the default gender assignment for new users to 'PENDING' for better data neutrality. Minor code cleanup, including the removal of a debug log and commenting out event creation, was also performed.
Highlights
- Gender Enum Localization: I've refactored the Gender Enum handling to return Korean names, ensuring that gender information is displayed in a user-friendly, localized format.
- Default Gender Assignment: I've updated the default gender for newly registered users via OAuth from 'MALE' to 'PENDING', providing a more neutral initial state when gender data is not explicitly provided.
- Exam Date Update: I've adjusted the date for a specific exam entry in the database initializer, reflecting an updated schedule.
- Code Cleanup: I've removed an unnecessary debug logging statement in the OAuth user service, cleaning up the code.
- Event Initialization Adjustment: I've temporarily commented out the event creation logic in the database initializer, which might be for testing or future re-implementation.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize 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 counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
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. ↩
There was a problem hiding this comment.
Code Review
This pull request correctly implements the change to return the Korean name for the Gender enum in API responses. The associated changes, such as updating the default gender for new OAuth users to PENDING and cleaning up some code, are logical and well-executed. I have one minor suggestion regarding commented-out code in the DatabaseInitializer to improve maintainability. Overall, this is a good set of changes.
| // eventRepository.save(EventJpaEntity.builder() | ||
| // .title("이벤트 " + i) | ||
| // .duration(new DurationJpaVO(LocalDate.now().plusDays(i), | ||
| // LocalDate.now().plusDays(i + 5))) | ||
| // .eventLink("https://mosu.life/event/" + i) | ||
| // .build()); |
There was a problem hiding this comment.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/life/mosu/mosuserver/global/initializer/DatabaseInitializer.java (1)
315-320: Clarify if event initialization disabling is temporary or permanent.The event creation logic has been commented out. If this is a permanent change, consider removing the commented code entirely for cleaner codebase maintenance. If temporary, consider adding a TODO comment explaining the reason and timeline for re-enabling.
If permanent, apply this diff to remove the dead code:
-// eventRepository.save(EventJpaEntity.builder() -// .title("이벤트 " + i) -// .duration(new DurationJpaVO(LocalDate.now().plusDays(i), -// LocalDate.now().plusDays(i + 5))) -// .eventLink("https://mosu.life/event/" + i) -// .build());If temporary, add a TODO comment explaining the reason.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/life/mosu/mosuserver/application/oauth/OAuthUserService.java(1 hunks)src/main/java/life/mosu/mosuserver/global/initializer/DatabaseInitializer.java(2 hunks)src/main/java/life/mosu/mosuserver/presentation/user/dto/response/UserInfoResponse.java(1 hunks)
🔇 Additional comments (3)
src/main/java/life/mosu/mosuserver/application/oauth/OAuthUserService.java (1)
65-65: Approve: ConfirmedGender.PENDINGsupportVerified that:
PENDING("미정")is declared insrc/main/java/life/mosu/mosuserver/domain/profile/entity/Gender.java.- Fallback usages in
OAuthUserService.javaandSignUpAccountRequest.javacorrectly referenceGender.PENDING.- All existing
getGenderName()calls (in response DTOs and repository mapping) handle PENDING without any missing cases.No further changes required.
src/main/java/life/mosu/mosuserver/presentation/user/dto/response/UserInfoResponse.java (1)
18-18: Localization Verified for Gender#getGenderName()The
Genderenum uses Lombok’s@Getteron thegenderNamefield, and its constants are defined with the Korean labels (남자,여자,미정), sogetGenderName()correctly returns the desired localized values. The null‐safe check inUserInfoResponseremains intact.No further changes required.
src/main/java/life/mosu/mosuserver/global/initializer/DatabaseInitializer.java (1)
196-196: LGTM! Exam date update appears correct.The date change for "노변중학교" from November 2, 2025 to October 26, 2025 is a straightforward data update with no implementation concerns.
✨ 구현한 기능
📢 논의하고 싶은 내용
🎸 기타
Summary by CodeRabbit
Bug Fixes
New Features
Chores