From 95ffb6991126df2ff8279625dd2c16188440a75b Mon Sep 17 00:00:00 2001 From: Klaus Date: Tue, 7 Jul 2026 17:56:12 +0900 Subject: [PATCH] =?UTF-8?q?feat(community):=20=EB=8C=93=EA=B8=80=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1=EC=9E=90=20=EC=8B=9D=EB=B3=84=EC=9E=90?= =?UTF-8?q?=EB=A5=BC=20=EC=9D=91=EB=8B=B5=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/CreatorChannelCommunityPostDetailResponse.kt | 4 ++++ .../in/web/CreatorChannelCommunityControllerTest.kt | 8 ++++++++ .../application/CreatorChannelCommunityFacadeTest.kt | 7 +++++++ .../dto/CreatorChannelCommunityPostDetailResponseTest.kt | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponse.kt index 1e64b15c..fe310d2f 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponse.kt @@ -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, diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityControllerTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityControllerTest.kt index 0fa5047e..4335bdb9 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityControllerTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityControllerTest.kt @@ -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", diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/application/CreatorChannelCommunityFacadeTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/application/CreatorChannelCommunityFacadeTest.kt index 26f0c976..9df9a3ab 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/application/CreatorChannelCommunityFacadeTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/application/CreatorChannelCommunityFacadeTest.kt @@ -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", diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponseTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponseTest.kt index 493461bc..2fd213a3 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponseTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityPostDetailResponseTest.kt @@ -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",