Skip to content

[FEATURE #22]: comment 도메인 기본 구현 - #23

Merged
khyun9807 merged 18 commits into
developfrom
feature/#22
Feb 5, 2026
Merged

[FEATURE #22]: comment 도메인 기본 구현#23
khyun9807 merged 18 commits into
developfrom
feature/#22

Conversation

@seoyeon2001

@seoyeon2001 seoyeon2001 commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator

📌 개요

Comment 도메인에 대한 CRUD 기능 API를 구현했습니다.

🔧 작업 내용

  • 댓글 작성 API 구현
  • 댓글 수정 API 구현
  • 댓글 삭제(soft delete) API 구현
  • 내 댓글 조회 API 구현
    • 무한스크롤 적용
    • 정렬: 최신 순
  • 게시글 댓글 조회 API 구현
    • 정렬: 최신 순

✅ 체크리스트

  • 테스트 완료(Postman, Swagger)

📝 기타 참고 사항

  • 현재 사용자 인증은 하드코딩된 userId로 처리되어 있으며, 추후 Spring Security 적용 시 @AuthenticationPrincipal로 대체 예정

📎 관련 이슈

Close #22

- 작성
- 삭제
- 수정
- 단건 조회
- 리스트 조회 (페이지네이션)
- 댓글 작성
- 댓글 수정
- 댓글 삭제
- 내 댓글 조회(무한 스크롤)
- 게시글 댓글 조회
@seoyeon2001 seoyeon2001 self-assigned this Jan 27, 2026
@seoyeon2001 seoyeon2001 added the ✨ Feature 새로운 기능을 추가합니다. label Jan 27, 2026
@seoyeon2001 seoyeon2001 linked an issue Jan 27, 2026 that may be closed by this pull request
4 tasks
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

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

이 풀 리퀘스트는 댓글 도메인의 핵심 기능을 구현하여 사용자가 게시글에 댓글을 작성, 수정, 삭제하고 자신의 댓글 및 특정 게시글의 댓글을 조회할 수 있도록 합니다. 또한, 관련 게시글 도메인의 기본적인 CRUD 기능과 데이터 유효성 검사, 표준화된 API 응답 및 오류 처리 메커니즘을 도입하여 애플리케이션의 기반 구조를 강화합니다.

Highlights

  • 댓글 도메인 CRUD API 구현: 댓글 생성, 수정, 소프트 삭제, 내 댓글 조회 (무한 스크롤), 게시글 댓글 조회 기능을 포함하는 Comment 도메인의 기본 CRUD API가 구현되었습니다.
  • 유효성 검사 의존성 추가: 요청 DTO에 대한 유효성 검사를 위해 spring-boot-starter-validation 의존성이 build.gradle에 추가되었습니다.
  • 댓글 및 게시글 엔티티 개선: Comment 및 Post 엔티티에 생성(create), 수정(update) 헬퍼 메서드가 추가되었으며, 소프트 삭제 로직에 멱등성(idempotency) 처리가 적용되었습니다. 또한, Comment 삭제 시 Post의 댓글 수를 감소시키는 로직이 추가되었습니다.
  • 새로운 리포지토리 및 서비스 계층 추가: Comment, Merchant, Post, User 도메인을 위한 새로운 JpaRepository 인터페이스와 해당 비즈니스 로직을 처리하는 Service 클래스들이 추가되었습니다.
  • API 응답 및 오류 코드 표준화: ApiResponse 클래스에 데이터 없이 성공 응답을 반환하는 ok() 메서드가 추가되었고, User, Post, Comment, Merchant 도메인에 특화된 상세 ErrorCode들이 정의되었습니다.
  • 게시글 도메인 API 및 기능 확장: 게시글 생성, 수정, 삭제, 단일 조회, 리스트 조회 API를 제공하는 PostController, PostRequest, PostResponse, PostSortType, PostService가 추가되어 게시글 관련 기능이 확장되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory 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 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.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

이 PR은 댓글 도메인의 기본 CRUD 기능을 구현하고 관련 게시글 기능도 추가했습니다. 전반적으로 코드가 잘 작성되었고, 특히 댓글 조회 시 삭제된 댓글 처리나 계층 구조를 고려한 정렬 로직이 인상적입니다. 몇 가지 개선점을 제안합니다.

  • getMyComments의 무한 스크롤 구현에서 hasNext 로직을 더 견고하게 개선할 수 있습니다.
  • getPostComments API에 페이지네이션을 추가하여 성능 문제를 예방해야 합니다.
  • 엔티티에서 타임스탬프를 설정하는 방식이 일관되지 않은 부분이 있어 통일이 필요합니다.
  • 게시글 삭제 시 관련 댓글을 처리하는 로직을 구현하여 데이터 정합성을 높이는 것이 좋습니다.
    자세한 내용은 각 파일의 리뷰 코멘트를 참고해주세요.

Comment thread src/main/java/com/payper/server/comment/controller/CommentController.java Outdated
Comment thread src/main/java/com/payper/server/comment/service/CommentService.java Outdated
Comment thread src/main/java/com/payper/server/post/controller/PostController.java Outdated
Comment thread src/main/java/com/payper/server/post/entity/Post.java
Comment thread src/main/java/com/payper/server/post/service/PostService.java Outdated
Comment thread src/main/java/com/payper/server/post/repository/PostRepository.java
Comment thread src/main/java/com/payper/server/comment/service/CommentService.java

@Answl Answl 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.

수고하셨습니다!
컨트롤러는 추후에 인증 끝낸 후에 수정하면 될 것 같습니다

Comment thread src/main/java/com/payper/server/comment/service/CommentService.java
@seoyeon2001

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

이 PR은 댓글 도메인의 기본 CRUD 기능 API를 구현하고, 게시글과의 연동을 통해 댓글 수 관리 및 게시글 삭제 시 댓글 소프트 삭제 기능을 추가했습니다. 커서 기반 페이지네이션을 적용하여 효율적인 댓글 조회를 가능하게 했으며, DTO와 서비스 계층을 잘 분리하여 구조적인 코드를 작성했습니다. 전반적으로 잘 구현되었지만, 몇 가지 개선 사항이 있습니다.

Comment thread src/main/java/com/payper/server/comment/controller/CommentController.java Outdated
Comment thread src/main/java/com/payper/server/comment/repository/CommentRepository.java Outdated
Comment thread src/main/java/com/payper/server/comment/entity/Comment.java
Comment thread src/main/java/com/payper/server/comment/service/CommentService.java Outdated

@khyun9807 khyun9807 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

고생하셨습니다!!! 그 컨트롤러 레이어 하드코딩되어있는 사용자 id 1L만
인자로 들어온 AuthenticationPricipal을 이용하는걸로 바꿔 주시면 바로 머지해도 될거 같아요.
머지 되면 전체 swagger작업 들어가겠습니다!

@khyun9807 khyun9807 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

고생하셨습니다!!

@khyun9807
khyun9807 merged commit e7be712 into develop Feb 5, 2026
1 check passed
@khyun9807
khyun9807 deleted the feature/#22 branch February 5, 2026 08:07
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.

[FEATURE]: comment 기본 구현

3 participants