Skip to content
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

feat: 스터디 관련 DTO에 멘토 이름 필드 추가 #945

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Mar 2, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

📝 참고사항

📚 기타

Summary by CodeRabbit

  • New Features
    • 스터디 관리 정보에 멘토의 이름이 추가되어, 보다 상세한 멘토 정보를 확인할 수 있습니다.
    • 스터디 학생 정보에도 멘토의 이름이 포함되어, 멘토 관련 정보를 한눈에 파악할 수 있습니다.
  • Enhancements
    • 스터디 조회 시 멘토 관련 정보를 포함하도록 데이터 조회 방식이 개선되었습니다.

@Sangwook02 Sangwook02 added the ✨ feature 새로운 기능 추가 및 수정 label Mar 2, 2025
@Sangwook02 Sangwook02 self-assigned this Mar 2, 2025
@Sangwook02 Sangwook02 requested a review from a team as a code owner March 2, 2025 12:09
@Sangwook02 Sangwook02 requested review from kckc0608 and uwoobeat March 2, 2025 12:09
Copy link

coderabbitai bot commented Mar 2, 2025

📝 Walkthrough

Walkthrough

이 PR은 StudyManagerDtoStudyStudentDto 두 DTO 레코드에 새 필드 mentorName(String)을 추가합니다. StudyManagerDto에서는 생성자와 from 메서드가 업데이트되어 멘토의 이름을 포함하도록 변경되었으며, StudyStudentDto에도 동일하게 mentorName 필드가 추가되었습니다. 또한, StudyV2RepositoryImpl 클래스의 findFetchAll 메서드에 멘토와의 조인을 추가하여 데이터 검색 방식을 개선했습니다.

Changes

File(s) Change Summary
src/.../StudyManagerDto.java, src/.../StudyStudentDto.java DTO 레코드에 새 필드 mentorName(String)을 추가하였으며, StudyManagerDto에서는 생성자와 from 메서드가 업데이트되어 멘토 이름을 포함하도록 수정됨.
src/.../StudyV2RepositoryImpl.java findFetchAll 메서드에 멘토와의 조인 추가하여 데이터 검색 방식 개선.

Possibly related PRs

Poem

안녕, 나는 작은 토끼, 코드 정원의 수호자야,
새로운 멘토 이름이 코드 숲에 춤추듯 피어났네.
DTO에 깃든 변화, 조용한 바람과도 같아서,
한 줄 한 줄 소중히 남는 발자국, 부드러운 미소로 물들어.
깡충깡충 뛰며 미래를 노래해, 모두에게 희망 전달!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15fe38b and aefce47.

📒 Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/dao/StudyV2RepositoryImpl.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/dao/StudyV2RepositoryImpl.java

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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 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.

Copy link

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

Choose a reason for hiding this comment

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

Hello @Sangwook02, 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!

Summary of Changes

This pull request addresses issue #944 by adding a mentorName field to the StudyManagerDto and StudyStudentDto data transfer objects. This change allows the study information to include the mentor's name, in addition to their ID. The changes involve modifying the StudyManagerDto and StudyStudentDto classes to include the new field and updating the from method in StudyManagerDto to populate the mentorName from the StudyV2 entity.

Highlights

  • Feature Enhancement: The StudyManagerDto and StudyStudentDto now include the mentor's name.
  • Data Transfer Object Modification: The StudyManagerDto and StudyStudentDto classes have been updated to include a mentorName field.
  • Data Population: The from method in StudyManagerDto has been updated to populate the mentorName field from the StudyV2 entity.

Changelog

  • src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyManagerDto.java
    • Added mentorName field to the StudyManagerDto record (line 28).
    • Modified the from method to include mentorName when creating a StudyManagerDto instance (line 45).
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyStudentDto.java
    • Added mentorName field to the StudyStudentDto record (line 25).
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 is currently in preview and 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 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.


Did you know?

The concept of DTOs is closely related to the design principle of minimizing data transfer between layers or tiers in an application architecture, improving performance and reducing coupling.

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.

@Sangwook02 Sangwook02 changed the title feat: 스터디 정보 DTO에 멘토 이름 필드 추가 feat: 스터디 관련 DTO에 멘토 이름 필드 추가 Mar 2, 2025
Copy link

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

Choose a reason for hiding this comment

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

Code Review

The pull request adds the mentor's name to the StudyManagerDto and StudyStudentDto. This change enhances the information provided by these DTOs, making it easier to display the mentor's name without needing to make additional calls to fetch the mentor's details. The code changes are straightforward and seem correct.

Merge Readiness

The code changes are straightforward and seem correct. I don't see any issues that need to be addressed before merging. However, as I am unable to directly approve the pull request, I recommend that others review and approve this code before merging.

Copy link

github-actions bot commented Mar 2, 2025

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyStudentDto.java (1)

9-11: JavaDoc 업데이트 제안

새로 추가된 mentorName 필드에 대한 설명을 JavaDoc에 추가하는 것이 좋을 것 같습니다.

 /**
  * 스터디 학생 DTO입니다. 디스코드 관련 ID가 포함되어 있지 않습니다.
+ * 멘토 ID와 멘토 이름 정보를 포함합니다.
  */
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyManagerDto.java (1)

10-12: JavaDoc 업데이트 제안

새로 추가된 mentorName 필드에 대한 설명을 JavaDoc에 추가하는 것이 좋을 것 같습니다.

 /**
  * 스터디 관리자 DTO입니다. 디스코드 관련 ID가 포함되어 있습니다.
+ * 멘토 ID와 멘토 이름 정보를 포함합니다.
  */
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c5c595 and 97df9fd.

📒 Files selected for processing (2)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyManagerDto.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyStudentDto.java (1 hunks)
🔇 Additional comments (3)
src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyStudentDto.java (1)

24-25: mentorName 필드가 적절하게 추가되었습니다.

스터디 정보에 멘토 이름을 추가하는 목표에 맞게 필드가 잘 추가되었습니다. DTO에 멘토 이름이 포함됨으로써 클라이언트에서 더 풍부한 정보를 제공할 수 있게 되었습니다.

src/main/java/com/gdschongik/gdsc/domain/studyv2/dto/dto/StudyManagerDto.java (2)

27-28: mentorName 필드가 적절하게 추가되었습니다.

StudyStudentDto와 일관성 있게 StudyManagerDto에도 멘토 이름 필드가 잘 추가되었습니다.


44-45: Null 안전성 확인 필요

study.getMentor()가 null을 반환할 가능성이 있다면 NullPointerException이 발생할 수 있습니다. 아래와 같이 Optional 또는 null 체크를 고려해 보세요.

                study.getDiscordChannelId(),
                study.getDiscordRoleId(),
-               study.getMentor().getId(),
-               study.getMentor().getName());
+               study.getMentor() != null ? study.getMentor().getId() : null,
+               study.getMentor() != null ? study.getMentor().getName() : null);

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -40,6 +41,7 @@ public static StudyManagerDto from(StudyV2 study) {
study.getApplicationPeriod(),
study.getDiscordChannelId(),
study.getDiscordRoleId(),
study.getMentor().getId());
study.getMentor().getId(),
Copy link
Member

Choose a reason for hiding this comment

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

멘토도 페치조인해서 가져오면 좋을 것 같아요

Copy link
Member Author

Choose a reason for hiding this comment

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

studyV2Repository.findFetchAll 매서드만 멘토 조인 추가했어요

Copy link

github-actions bot commented Mar 2, 2025

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link

github-actions bot commented Mar 3, 2025

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

@Sangwook02 Sangwook02 merged commit e81bdfb into develop Mar 3, 2025
2 checks passed
@Sangwook02 Sangwook02 deleted the feature/944-study-dto-mentor-name-field branch March 3, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature 새로운 기능 추가 및 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ 스터디 관련 DTO에 멘토 이름 필드 추가
2 participants