feat(community): 댓글 비밀 여부를 조회한다

This commit is contained in:
2026-07-08 01:26:31 +09:00
parent 0cdcc42100
commit e013cdb39d
5 changed files with 10 additions and 1 deletions

View File

@@ -260,6 +260,7 @@ class DefaultCreatorChannelCommunityQueryRepository(
creatorCommunityComment.member.profileImage,
creatorCommunityComment.member.nickname,
creatorCommunityComment.comment,
creatorCommunityComment.isSecret,
creatorCommunityComment.createdAt
)
@@ -556,6 +557,7 @@ class DefaultCreatorChannelCommunityQueryRepository(
writerProfilePath = get(creatorCommunityComment.member.profileImage),
writerNickname = get(creatorCommunityComment.member.nickname)!!,
content = get(creatorCommunityComment.comment)!!,
isSecret = get(creatorCommunityComment.isSecret)!!,
createdAt = get(creatorCommunityComment.createdAt)!!
)
}

View File

@@ -257,6 +257,7 @@ class CreatorChannelCommunityQueryService(
writerProfileImageUrl = writerProfilePath.toCdnUrl(cloudFrontHost) ?: defaultProfileImageUrl(),
writerNickname = writerNickname.removeDeletedNicknamePrefix(),
content = content,
isSecret = isSecret,
createdAt = createdAt,
latestReply = latestReply
)

View File

@@ -21,6 +21,7 @@ data class CreatorChannelCommunityComment(
val writerProfileImageUrl: String,
val writerNickname: String,
val content: String,
val isSecret: Boolean,
val createdAt: LocalDateTime,
val latestReply: CreatorChannelCommunityReply?
)

View File

@@ -106,6 +106,7 @@ data class CreatorChannelCommunityCommentRecord(
val writerProfilePath: String?,
val writerNickname: String,
val content: String,
val isSecret: Boolean,
val createdAt: LocalDateTime
)

View File

@@ -195,6 +195,7 @@ class CreatorChannelCommunityQueryServiceTest {
assertEquals(20, detail.comments.comments.size)
assertEquals(true, detail.comments.hasNext)
assertEquals(101L, detail.comments.comments.first().writerId)
assertEquals(false, detail.comments.comments.first().isSecret)
assertEquals("reply-writer", detail.comments.comments.first().latestReply?.writerNickname)
assertEquals(200L, detail.comments.comments.first().latestReply?.writerId)
assertEquals("https://cdn.test/profile/default-profile.png", detail.comments.comments.first().writerProfileImageUrl)
@@ -237,6 +238,7 @@ class CreatorChannelCommunityQueryServiceTest {
assertEquals(50, comments.comments.size)
assertEquals(true, comments.hasNext)
assertEquals(101L, comments.comments.first().writerId)
assertEquals(false, comments.comments.first().isSecret)
assertEquals("https://cdn.test/profile/1.png", comments.comments.first().writerProfileImageUrl)
assertEquals(100L, comments.comments[1].latestReply?.commentId)
assertEquals(200L, comments.comments[1].latestReply?.writerId)
@@ -499,7 +501,8 @@ private fun communityCommentRecord(
commentId: Long,
parentCommentId: Long? = null,
writerProfilePath: String? = null,
writerNickname: String = "writer-$commentId"
writerNickname: String = "writer-$commentId",
isSecret: Boolean = false
): CreatorChannelCommunityCommentRecord {
return CreatorChannelCommunityCommentRecord(
commentId = commentId,
@@ -509,6 +512,7 @@ private fun communityCommentRecord(
writerProfilePath = writerProfilePath,
writerNickname = writerNickname,
content = "comment-$commentId",
isSecret = isSecret,
createdAt = LocalDateTime.of(2026, 7, 6, 10, 0).plusMinutes(commentId)
)
}