Skip to content

Conversation

@kjhh2605
Copy link
Contributor

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

@kjhh2605 kjhh2605 requested review from Copilot and jwon0523 August 21, 2025 15:08
@kjhh2605 kjhh2605 linked an issue Aug 21, 2025 that may be closed by this pull request
3 tasks
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.

Summary of Changes

Hello @kjhh2605, 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은 댓글 작성 시 반환되는 응답 데이터에 댓글 작성자의 정보를 포함하도록 개선합니다. 기존에는 댓글 ID와 같은 기본적인 정보만 제공되었으나, 이제는 작성자의 이름 ID, 닉네임, 프로필 이미지 URL이 함께 제공되어 API 사용자가 댓글과 관련된 사용자 정보를 즉시 확인할 수 있게 됩니다. 이는 사용자 경험을 향상시키고 추가적인 API 호출 없이 필요한 정보를 얻을 수 있도록 합니다.

Highlights

  • 댓글 작성 응답 DTO 개선: 댓글 작성 후 반환되는 WriteCommentResponseDTO에 댓글 작성자의 nameId, nickname, profileImageUrl 필드를 추가했습니다.
  • CommentConverter 업데이트: CommentConverter의 CommentToWriteCommentResponseDTO 메서드에서 새로 추가된 사용자 정보를 WriteCommentResponseDTO에 매핑하도록 수정했습니다.
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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

  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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds user information fields to the comment creation response DTO. The change enhances the comment write response by including the user's nameId, nickname, and profile image URL alongside the existing comment data.

  • Added user identification fields (nameId, nickname, profileImageUrl) to WriteCommentResponseDTO
  • Updated the converter to populate these new fields from the comment's associated user

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
CommentResponseDTO.java Added three new user-related fields to WriteCommentResponseDTO class
CommentConverter.java Updated converter to populate new user fields from comment.getUser()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

private String nameId;
@NotNull
private String nickname;
@NotNull
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The @NotNull annotations on these fields may cause validation issues if any user fields are null in the database. Consider using @nullable or handling null values appropriately, especially for profileImageUrl which might be optional.

Suggested change
@NotNull

Copilot uses AI. Check for mistakes.
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

안녕하세요. 댓글 작성 시 응답 DTO에 사용자 정보를 추가하는 변경 사항 잘 보았습니다. 전반적으로 PR의 목적에 맞게 잘 구현되었지만, 코드의 안정성과 가독성을 높이기 위해 몇 가지 제안 사항을 드립니다. WriteCommentResponseDTOprofileImageUrl 필드는 User 엔티티에서 null을 허용하므로 @NotNull 제약 조건을 제거하는 것이 안전합니다. 또한 CommentConverter에서 빌더 패턴을 사용할 때 DTO 필드 선언 순서와 일치시키면 코드를 이해하고 유지보수하기가 더 쉬워질 것입니다. 자세한 내용은 각 파일의 주석을 참고해주세요.

Comment on lines +22 to +23
@NotNull
private String profileImageUrl;

Choose a reason for hiding this comment

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

high

User 엔티티의 profileImageUrl 필드는 null 값을 가질 수 있습니다. 하지만 WriteCommentResponseDTO에서는 이 필드를 @NotNull로 지정하고 있어, 프로필 이미지가 없는 사용자의 댓글 생성 시 응답 데이터가 DTO의 제약 조건에 위배될 수 있습니다. 이는 클라이언트 측에서 예기치 않은 오류를 발생시킬 수 있으므로, @NotNull 어노테이션을 제거하여 실제 데이터 모델을 정확하게 반영하는 것이 좋습니다.

Suggested change
@NotNull
private String profileImageUrl;
private String profileImageUrl;

Comment on lines +24 to +26
.nameId(comment.getUser().getNameId())
.profileImageUrl(comment.getUser().getProfileImageUrl())
.nickname(comment.getUser().getNickname())

Choose a reason for hiding this comment

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

medium

코드 가독성과 유지보수성을 향상시키기 위해, CommentConverter에서 WriteCommentResponseDTO 객체를 생성할 때 빌더의 메서드 호출 순서를 DTO 클래스에 선언된 필드 순서(nameId, nickname, profileImageUrl)와 동일하게 맞추는 것을 제안합니다. 이렇게 하면 코드를 읽는 사람이 DTO의 구조를 더 쉽게 파악할 수 있습니다.

Suggested change
.nameId(comment.getUser().getNameId())
.profileImageUrl(comment.getUser().getProfileImageUrl())
.nickname(comment.getUser().getNickname())
.nameId(comment.getUser().getNameId())
.nickname(comment.getUser().getNickname())
.profileImageUrl(comment.getUser().getProfileImageUrl())

Copy link
Contributor

@jwon0523 jwon0523 left a comment

Choose a reason for hiding this comment

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

긴급사정으로 승인해드리겠습니다 ㅋㅋㅋㅋ

@jwon0523 jwon0523 merged commit b45b512 into main Aug 21, 2025
2 checks passed
@jwon0523 jwon0523 deleted the feat/195-modify-comment-dto branch August 21, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 댓글 작성 res DTO 수정

3 participants