Merged
Conversation
soft delete와 관리자에 의해 삭제됨을 표현하기 위한 status 필드, depth 1의 대댓글을 표현하기 위한 parent_id 필드를 만들었습니다
대댓글 생성 분기 추가
대댓글이 없을 경우(즉, 원댓글인데 대댓글이 없거나 대댓글일 경우 - depth 1 제한이라 대댓글엔 대댓글이 없음)에는 hard delete, 그 외에는 soft delete
삭제나 밴 당한 댓글은 셀 필요 없으므로
추후 삭제한 것과 신고로 밴된 것의 차별을 두기 위해 status = BANNED 적용
원댓글 작성자와 컬렉션 작성자가 같다면 하나만 발송돼야 함
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 요약(Summary)
대댓글 기능을 구현했습니다.
parentId가 null이면 원댓글, 그렇지 않으면 대댓글이며, 댓글 조회 api의 응답으로 부모-자식 관계에 따라 트리 구조로 반환됩니다. 대댓글은 정책 상 depth 최대 1로 제한됩니다.
status 필드는, 대댓글이 있는 원댓글의 경우 soft delete가 필요하여 추가했습니다. deleted_at 대신 status를 썼기에 신고로 차단된 댓글과 직접 삭제한 댓글을 분리해서 표현할 수 있습니다. 이를 위한 content 대치 설정도 추가했습니다.
comment 생성 api의 요청 바디에 commentId를 담아서 보낼 수 있습니다(optional). 이걸 담아 보내면 답글로 생성됩니다.
📸스크린샷 (선택)
💬 공유사항
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.