Skip to content

fix: 댓글 알림에 parentCommentId 필드 추가 - #57

Merged
s26047-code merged 1 commit into
developfrom
fix/notification-parent-comment-id
Aug 20, 2026
Merged

s26047-code merged 1 commit into
developfrom
fix/notification-parent-comment-id

Conversation

@s26047-code

Copy link
Copy Markdown
Contributor

구현 내용

댓글/답글 알림 구분 필드 추가

  • 알림 응답에 parentCommentId 필드 추가
  • 댓글 알림과 답글 알림을 프론트에서 구분할 수 있도록 처리

변경 사항

notification

  • NotificationResponseDtoparentCommentId 필드 추가
  • NotificationService.toResponseDtos()에서 commentId 목록으로 Comment 일괄 조회 후 parent.id 매핑 (N+1 방지)
  • NotificationResponseDto.from() 시그니처에 Comment 파라미터 추가

변경된 API

  • GET /alarm/comment — 응답에 parentCommentId 필드 추가
  • parentCommentIdnull이면 일반 댓글, 값이 있으면 답글(해당 값은 부모 댓글 id)

처리 방식

  • Comment.parentnull이 아닌 경우에만 parentCommentId에 부모 댓글 id를 채워 반환
  • 좋아요 알림(commentIdnull)은 parentCommentId도 자동으로 null 반환

테스트 방법

  • 일반 댓글에 대한 알림 조회 시 parentCommentIdnull로 내려오는지 확인한다.
  • 답글에 대한 알림 조회 시 parentCommentId에 부모 댓글 id가 정상적으로 채워지는지 확인한다.
  • 좋아요 알림 조회 시 commentId, parentCommentId 모두 null로 내려오는지 확인한다.

참고사항

  • 기존 commentId 필드는 그대로 유지되며, 답글 필드인 parentCommentId만 추가했습니다.

@s26047-code
s26047-code merged commit 9dbd3e9 into develop Aug 20, 2026
1 check passed
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.

3 participants