Compare commits
3 Commits
7f04899ca5
...
95ffb69911
| Author | SHA1 | Date | |
|---|---|---|---|
| 95ffb69911 | |||
| 741f71d8a9 | |||
| bf103dedd7 |
@@ -182,6 +182,7 @@ data class CreatorChannelCommunityCommentsResponse(
|
||||
|
||||
data class CreatorChannelCommunityCommentResponse(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
@@ -192,6 +193,7 @@ data class CreatorChannelCommunityCommentResponse(
|
||||
fun from(comment: CreatorChannelCommunityComment): CreatorChannelCommunityCommentResponse {
|
||||
return CreatorChannelCommunityCommentResponse(
|
||||
commentId = comment.commentId,
|
||||
writerId = comment.writerId,
|
||||
writerProfileImageUrl = comment.writerProfileImageUrl,
|
||||
writerNickname = comment.writerNickname,
|
||||
content = comment.content,
|
||||
@@ -225,6 +227,7 @@ data class CreatorChannelCommunityRepliesResponse(
|
||||
|
||||
data class CreatorChannelCommunityReplyResponse(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
@@ -234,6 +237,7 @@ data class CreatorChannelCommunityReplyResponse(
|
||||
fun from(reply: CreatorChannelCommunityReply): CreatorChannelCommunityReplyResponse {
|
||||
return CreatorChannelCommunityReplyResponse(
|
||||
commentId = reply.commentId,
|
||||
writerId = reply.writerId,
|
||||
writerProfileImageUrl = reply.writerProfileImageUrl,
|
||||
writerNickname = reply.writerNickname,
|
||||
content = reply.content,
|
||||
@@ -270,6 +274,7 @@ data class CreatorChannelCommunityComments(
|
||||
|
||||
data class CreatorChannelCommunityComment(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
@@ -286,6 +291,7 @@ data class CreatorChannelCommunityReplies(
|
||||
|
||||
data class CreatorChannelCommunityReply(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
|
||||
@@ -194,6 +194,7 @@ data class CreatorChannelCommunityCommentsResponse(
|
||||
|
||||
data class CreatorChannelCommunityCommentResponse(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
@@ -203,6 +204,7 @@ data class CreatorChannelCommunityCommentResponse(
|
||||
|
||||
data class CreatorChannelCommunityReplyResponse(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
|
||||
@@ -77,6 +77,7 @@ data class CreatorChannelCommunityCommentsResponse(
|
||||
|
||||
data class CreatorChannelCommunityCommentResponse(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
@@ -87,6 +88,7 @@ data class CreatorChannelCommunityCommentResponse(
|
||||
fun from(comment: CreatorChannelCommunityComment): CreatorChannelCommunityCommentResponse {
|
||||
return CreatorChannelCommunityCommentResponse(
|
||||
commentId = comment.commentId,
|
||||
writerId = comment.writerId,
|
||||
writerProfileImageUrl = comment.writerProfileImageUrl,
|
||||
writerNickname = comment.writerNickname,
|
||||
content = comment.content,
|
||||
@@ -120,6 +122,7 @@ data class CreatorChannelCommunityRepliesResponse(
|
||||
|
||||
data class CreatorChannelCommunityReplyResponse(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
@@ -129,6 +132,7 @@ data class CreatorChannelCommunityReplyResponse(
|
||||
fun from(reply: CreatorChannelCommunityReply): CreatorChannelCommunityReplyResponse {
|
||||
return CreatorChannelCommunityReplyResponse(
|
||||
commentId = reply.commentId,
|
||||
writerId = reply.writerId,
|
||||
writerProfileImageUrl = reply.writerProfileImageUrl,
|
||||
writerNickname = reply.writerNickname,
|
||||
content = reply.content,
|
||||
|
||||
@@ -253,6 +253,7 @@ class CreatorChannelCommunityQueryService(
|
||||
): CreatorChannelCommunityComment {
|
||||
return CreatorChannelCommunityComment(
|
||||
commentId = commentId,
|
||||
writerId = writerId,
|
||||
writerProfileImageUrl = writerProfilePath.toCdnUrl(cloudFrontHost) ?: defaultProfileImageUrl(),
|
||||
writerNickname = writerNickname.removeDeletedNicknamePrefix(),
|
||||
content = content,
|
||||
@@ -264,6 +265,7 @@ class CreatorChannelCommunityQueryService(
|
||||
private fun CreatorChannelCommunityCommentRecord.toReplyDomain(): CreatorChannelCommunityReply {
|
||||
return CreatorChannelCommunityReply(
|
||||
commentId = commentId,
|
||||
writerId = writerId,
|
||||
writerProfileImageUrl = writerProfilePath.toCdnUrl(cloudFrontHost) ?: defaultProfileImageUrl(),
|
||||
writerNickname = writerNickname.removeDeletedNicknamePrefix(),
|
||||
content = content,
|
||||
|
||||
@@ -17,6 +17,7 @@ data class CreatorChannelCommunityComments(
|
||||
|
||||
data class CreatorChannelCommunityComment(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
@@ -33,6 +34,7 @@ data class CreatorChannelCommunityReplies(
|
||||
|
||||
data class CreatorChannelCommunityReply(
|
||||
val commentId: Long,
|
||||
val writerId: Long,
|
||||
val writerProfileImageUrl: String,
|
||||
val writerNickname: String,
|
||||
val content: String,
|
||||
|
||||
@@ -180,7 +180,9 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
|
||||
.andExpect(jsonPath("$.data.postId").value(101))
|
||||
.andExpect(jsonPath("$.data.isLiked").value(true))
|
||||
.andExpect(jsonPath("$.data.comments.commentCount").value(1))
|
||||
.andExpect(jsonPath("$.data.comments.comments[0].writerId").value(20))
|
||||
.andExpect(jsonPath("$.data.comments.comments[0].latestReply.commentId").value(202))
|
||||
.andExpect(jsonPath("$.data.comments.comments[0].latestReply.writerId").value(21))
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -203,7 +205,9 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
|
||||
)
|
||||
.andExpect(status().isOk)
|
||||
.andExpect(jsonPath("$.data.commentCount").value(1))
|
||||
.andExpect(jsonPath("$.data.comments[0].writerId").value(20))
|
||||
.andExpect(jsonPath("$.data.comments[0].latestReply.commentId").value(202))
|
||||
.andExpect(jsonPath("$.data.comments[0].latestReply.writerId").value(21))
|
||||
.andExpect(jsonPath("$.data.hasNext").value(false))
|
||||
}
|
||||
|
||||
@@ -259,6 +263,7 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
|
||||
.andExpect(status().isOk)
|
||||
.andExpect(jsonPath("$.data.replyCount").value(1))
|
||||
.andExpect(jsonPath("$.data.replies[0].commentId").value(202))
|
||||
.andExpect(jsonPath("$.data.replies[0].writerId").value(21))
|
||||
.andExpect(jsonPath("$.data.replies[0].latestReply").doesNotExist())
|
||||
}
|
||||
|
||||
@@ -368,12 +373,14 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
|
||||
comments = listOf(
|
||||
CreatorChannelCommunityCommentResponse(
|
||||
commentId = 201L,
|
||||
writerId = 20L,
|
||||
writerProfileImageUrl = "https://cdn.test/writer.png",
|
||||
writerNickname = "writer",
|
||||
content = "comment",
|
||||
createdAtUtc = "2026-07-06T03:00:00Z",
|
||||
latestReply = CreatorChannelCommunityReplyResponse(
|
||||
commentId = 202L,
|
||||
writerId = 21L,
|
||||
writerProfileImageUrl = "https://cdn.test/replier.png",
|
||||
writerNickname = "replier",
|
||||
content = "reply",
|
||||
@@ -393,6 +400,7 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
|
||||
replies = listOf(
|
||||
CreatorChannelCommunityReplyResponse(
|
||||
commentId = 202L,
|
||||
writerId = 21L,
|
||||
writerProfileImageUrl = "https://cdn.test/replier.png",
|
||||
writerNickname = "replier",
|
||||
content = "reply",
|
||||
|
||||
@@ -106,6 +106,8 @@ class CreatorChannelCommunityFacadeTest {
|
||||
assertEquals(101L, response.postId)
|
||||
assertTrue(response.isLiked)
|
||||
assertEquals(1, response.comments.commentCount)
|
||||
assertEquals(20L, response.comments.comments.first().writerId)
|
||||
assertEquals(21L, response.comments.comments.first().latestReply?.writerId)
|
||||
assertEquals(201L, response.comments.comments.first().latestReply?.commentId)
|
||||
}
|
||||
|
||||
@@ -123,6 +125,8 @@ class CreatorChannelCommunityFacadeTest {
|
||||
assertEquals(1, response.commentCount)
|
||||
assertEquals(0, response.page)
|
||||
assertEquals(20, response.size)
|
||||
assertEquals(20L, response.comments.first().writerId)
|
||||
assertEquals(21L, response.comments.first().latestReply?.writerId)
|
||||
assertEquals(201L, response.comments.first().latestReply?.commentId)
|
||||
}
|
||||
|
||||
@@ -139,6 +143,7 @@ class CreatorChannelCommunityFacadeTest {
|
||||
|
||||
assertEquals(1, response.replyCount)
|
||||
assertEquals(201L, response.replies.first().commentId)
|
||||
assertEquals(21L, response.replies.first().writerId)
|
||||
assertTrue(response.hasNext)
|
||||
}
|
||||
|
||||
@@ -208,6 +213,7 @@ class CreatorChannelCommunityFacadeTest {
|
||||
comments = listOf(
|
||||
CreatorChannelCommunityComment(
|
||||
commentId = 200L,
|
||||
writerId = 20L,
|
||||
writerProfileImageUrl = "https://cdn.test/writer.png",
|
||||
writerNickname = "writer",
|
||||
content = "comment",
|
||||
@@ -226,6 +232,7 @@ class CreatorChannelCommunityFacadeTest {
|
||||
replies = listOf(
|
||||
CreatorChannelCommunityReply(
|
||||
commentId = 201L,
|
||||
writerId = 21L,
|
||||
writerProfileImageUrl = "https://cdn.test/replier.png",
|
||||
writerNickname = "replier",
|
||||
content = "reply",
|
||||
|
||||
@@ -31,14 +31,18 @@ class CreatorChannelCommunityPostDetailResponseTest {
|
||||
assertTrue(detailJson["isLiked"].asBoolean())
|
||||
assertTrue(detailJson["comments"]["hasNext"].asBoolean())
|
||||
assertTrue(detailJson["comments"]["comments"][0].has("latestReply"))
|
||||
assertTrue(detailJson["comments"]["comments"][0].has("writerId"))
|
||||
assertTrue(detailJson["comments"]["comments"][0]["latestReply"].has("commentId"))
|
||||
assertTrue(detailJson["comments"]["comments"][0]["latestReply"].has("writerId"))
|
||||
assertTrue(repliesJson["hasNext"].asBoolean())
|
||||
assertTrue(repliesJson["replies"][0].has("writerId"))
|
||||
assertFalse(repliesJson["replies"][0].has("latestReply"))
|
||||
}
|
||||
|
||||
private fun createDetail(): CreatorChannelCommunityPostDetail {
|
||||
val reply = CreatorChannelCommunityReply(
|
||||
commentId = 2L,
|
||||
writerId = 20L,
|
||||
writerProfileImageUrl = "https://cdn.test/reply.png",
|
||||
writerNickname = "reply-writer",
|
||||
content = "reply",
|
||||
@@ -67,6 +71,7 @@ class CreatorChannelCommunityPostDetailResponseTest {
|
||||
comments = listOf(
|
||||
CreatorChannelCommunityComment(
|
||||
commentId = 1L,
|
||||
writerId = 10L,
|
||||
writerProfileImageUrl = "https://cdn.test/comment.png",
|
||||
writerNickname = "comment-writer",
|
||||
content = "comment",
|
||||
@@ -86,6 +91,7 @@ class CreatorChannelCommunityPostDetailResponseTest {
|
||||
replies = listOf(
|
||||
CreatorChannelCommunityReply(
|
||||
commentId = 2L,
|
||||
writerId = 20L,
|
||||
writerProfileImageUrl = "https://cdn.test/reply.png",
|
||||
writerNickname = "reply-writer",
|
||||
content = "reply",
|
||||
|
||||
@@ -194,7 +194,9 @@ class CreatorChannelCommunityQueryServiceTest {
|
||||
assertEquals(21, detail.comments.commentCount)
|
||||
assertEquals(20, detail.comments.comments.size)
|
||||
assertEquals(true, detail.comments.hasNext)
|
||||
assertEquals(101L, detail.comments.comments.first().writerId)
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -234,8 +236,10 @@ class CreatorChannelCommunityQueryServiceTest {
|
||||
assertEquals((1L..50L).toList(), port.latestReplyCommentIds)
|
||||
assertEquals(50, comments.comments.size)
|
||||
assertEquals(true, comments.hasNext)
|
||||
assertEquals(101L, comments.comments.first().writerId)
|
||||
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)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -255,6 +259,7 @@ class CreatorChannelCommunityQueryServiceTest {
|
||||
assertEquals(0L, port.replyListOffset)
|
||||
assertEquals(51, port.replyListLimit)
|
||||
assertEquals(true, replies.hasNext)
|
||||
assertEquals(101L, replies.replies.first().writerId)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user