Skip to content

Conversation

@joyewon0705
Copy link
Collaborator

📌 개요

  • 댓글 수정 및 삭제 기능을 구현했습니다.
  • Service, Controller, Swagger 문서 및 단위/통합 테스트 포함.

🔨 작업 내용

1. Controller

  • PUT /api/posts/{postId}/comments/{commentId} → 댓글 수정
  • DELETE /api/posts/{postId}/comments/{commentId} → 댓글 삭제

2. Service

  • updateComment

    • 게시글, 댓글 조회 후 작성자 검증
    • 내용 업데이트
  • deleteComment

    • 게시글, 댓글 조회 후 작성자 검증
    • 댓글 삭제 처리

3. DTO

  • CommentRequest → 댓글 작성 및 수정 요청 DTO 재사용
  • CommentResponse → 수정된 내용 반영

4. Entity

  • Comment 엔티티에 updateContent (혹은 update) 메서드 추가

5. ErrorCode

  • COMMENT_NOT_FOUND (404) → 존재하지 않는 댓글
  • COMMENT_NO_PERMISSION (403) → 댓글 작성자가 아님

6. Swagger

  • CommentControllerDocs댓글 수정/삭제 API 문서화
    • 성공/실패/예외 응답 예시 작성

7. Test

  • Service Test

    • 댓글 수정 성공 / 실패 (게시글 없음, 댓글 없음, 작성자 아님)
    • 댓글 삭제 성공 / 실패 (게시글 없음, 댓글 없음, 작성자 아님)
  • Controller Test (MockMvc)

    • 수정/삭제 성공
    • 실패 케이스 (인증 없음, 작성자 아님, 필드 누락, 엔티티 없음 등) 검증

🔗 관련 이슈

Closes #159

📝 참고 사항

✅ 체크리스트

  • 기능 동작 확인
  • 테스트 코드 작성
  • 문서/주석 추가 및 최신화

@github-actions github-actions bot changed the title Feat: 댓글 수정 및 삭제 API 구현 Feat: 댓글 수정 및 삭제 API 구현 (#159) Oct 2, 2025
@joyewon0705 joyewon0705 merged commit f4a59a6 into dev Oct 2, 2025
2 checks passed
@github-actions github-actions bot deleted the Feat/159 branch October 2, 2025 08:45
namgigun pushed a commit that referenced this pull request Oct 4, 2025
* Feat: 댓글 수정 API 구현

* Test: 테스트 작성

* Docs: Swagger 문서 작성

* Feat: 댓글 삭제 API 구현

* Test: 테스트 작성

* Docs: Swagger 문서 작성
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.

4 participants