Skip to content

[Feat] 댓글 수정 및 삭제 API 구현#130

Merged
kkw610 merged 1 commit into
developfrom
feat/#128
May 29, 2026
Merged

[Feat] 댓글 수정 및 삭제 API 구현#130
kkw610 merged 1 commit into
developfrom
feat/#128

Conversation

@kkw610

@kkw610 kkw610 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

#️⃣연관된 이슈

#128

📝작업 내용

댓글 수정 및 삭제 API 추가
본인이 작성한 댓글만 수정/삭제 가능하며, 삭제는 소프트 삭제로 처리

QuestionComment

  • updateContent(): 댓글 내용 수정 메서드 추가
  • softDelete(): 댓글 소프트 삭제 메서드 추가

QuestionSuccessCode

  • COMMENT_UPDATED, COMMENT_DELETED 추가

QuestionReqDTO

  • CommentUpdateReq 추가

QuestionResDTO

  • CommentUpdateDeleteRes 추가

QuestionService

  • updateComment(): 댓글 수정 로직 구현
  • deleteComment(): 댓글 삭제 로직 구현
  • validateCommentOwner(): 댓글 작성자 본인 여부 검증
  • findComment(): 삭제되지 않은 댓글 조회 헬퍼

QuestionController

  • PATCH /api/comments/{commentId}: 댓글 수정 엔드포인트
  • DELETE /api/comments/{commentId}: 댓글 삭제 엔드포인트

테스트

  • 본인 댓글 수정 → 200 OK 확인
  • 타인 댓글 수정 시도 → 403 Forbidden 확인
  • 본인 댓글 삭제 → 200 OK 및 deletedAt 값 존재 확인
  • 타인 댓글 삭제 시도 → 403 Forbidden 확인

Closes #128

@kkw610 kkw610 self-assigned this May 29, 2026
@kkw610 kkw610 linked an issue May 29, 2026 that may be closed by this pull request
6 tasks
@kkw610 kkw610 merged commit c16b514 into develop May 29, 2026
1 check passed
@kkw610 kkw610 deleted the feat/#128 branch May 29, 2026 13:26
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] 댓글 수정 및 삭제 API 구현

1 participant