From 9bb14aacdff97b4cedaf6b8c78007295eda08431 Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 8 Jul 2026 01:26:44 +0900 Subject: [PATCH] =?UTF-8?q?feat(community):=20=EB=8C=93=EA=B8=80=20?= =?UTF-8?q?=EB=B9=84=EB=B0=80=20=EC=97=AC=EB=B6=80=EB=A5=BC=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/dto/CreatorChannelCommunityPostDetailResponse.kt | 3 +++ .../adapter/in/web/CreatorChannelCommunityControllerTest.kt | 3 +++ .../adapter/in/web/CreatorChannelCommunityEndToEndTest.kt | 2 ++ .../community/application/CreatorChannelCommunityFacadeTest.kt | 3 +++ .../dto/CreatorChannelCommunityPostDetailResponseTest.kt | 2 ++ 5 files changed, 13 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 fe310d2f..eb1ec27e 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 @@ -81,6 +81,8 @@ data class CreatorChannelCommunityCommentResponse( val writerProfileImageUrl: String, val writerNickname: String, val content: String, + @JsonProperty("isSecret") + val isSecret: Boolean, val createdAtUtc: String, val latestReply: CreatorChannelCommunityReplyResponse? ) { @@ -92,6 +94,7 @@ data class CreatorChannelCommunityCommentResponse( writerProfileImageUrl = comment.writerProfileImageUrl, writerNickname = comment.writerNickname, content = comment.content, + isSecret = comment.isSecret, createdAtUtc = comment.createdAt.toUtcIso(), latestReply = comment.latestReply?.let(CreatorChannelCommunityReplyResponse::from) ) 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 4335bdb9..ce9c67b4 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 @@ -181,6 +181,7 @@ class CreatorChannelCommunityControllerTest @Autowired constructor( .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].isSecret").value(true)) .andExpect(jsonPath("$.data.comments.comments[0].latestReply.commentId").value(202)) .andExpect(jsonPath("$.data.comments.comments[0].latestReply.writerId").value(21)) } @@ -206,6 +207,7 @@ 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].isSecret").value(true)) .andExpect(jsonPath("$.data.comments[0].latestReply.commentId").value(202)) .andExpect(jsonPath("$.data.comments[0].latestReply.writerId").value(21)) .andExpect(jsonPath("$.data.hasNext").value(false)) @@ -377,6 +379,7 @@ class CreatorChannelCommunityControllerTest @Autowired constructor( writerProfileImageUrl = "https://cdn.test/writer.png", writerNickname = "writer", content = "comment", + isSecret = true, createdAtUtc = "2026-07-06T03:00:00Z", latestReply = CreatorChannelCommunityReplyResponse( commentId = 202L, diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityEndToEndTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityEndToEndTest.kt index a9ecfc29..c805fb01 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityEndToEndTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/adapter/in/web/CreatorChannelCommunityEndToEndTest.kt @@ -204,7 +204,9 @@ class CreatorChannelCommunityEndToEndTest @Autowired constructor( .andExpect(jsonPath("$.data.commentCount").value(2)) .andExpect(jsonPath("$.data.comments.length()").value(2)) .andExpect(jsonPath("$.data.comments[0].commentId").value(fixture.ownSecretCommentId)) + .andExpect(jsonPath("$.data.comments[0].isSecret").value(true)) .andExpect(jsonPath("$.data.comments[1].commentId").value(fixture.publicCommentId)) + .andExpect(jsonPath("$.data.comments[1].isSecret").value(false)) .andExpect(jsonPath("$.data.comments[1].latestReply.commentId").value(fixture.publicReplyId)) } 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 9df9a3ab..ef2dec13 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 @@ -107,6 +107,7 @@ class CreatorChannelCommunityFacadeTest { assertTrue(response.isLiked) assertEquals(1, response.comments.commentCount) assertEquals(20L, response.comments.comments.first().writerId) + assertTrue(response.comments.comments.first().isSecret) assertEquals(21L, response.comments.comments.first().latestReply?.writerId) assertEquals(201L, response.comments.comments.first().latestReply?.commentId) } @@ -126,6 +127,7 @@ class CreatorChannelCommunityFacadeTest { assertEquals(0, response.page) assertEquals(20, response.size) assertEquals(20L, response.comments.first().writerId) + assertTrue(response.comments.first().isSecret) assertEquals(21L, response.comments.first().latestReply?.writerId) assertEquals(201L, response.comments.first().latestReply?.commentId) } @@ -217,6 +219,7 @@ class CreatorChannelCommunityFacadeTest { writerProfileImageUrl = "https://cdn.test/writer.png", writerNickname = "writer", content = "comment", + isSecret = true, createdAt = LocalDateTime.of(2026, 7, 6, 3, 0), latestReply = createReplies().replies.first() ) 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 2fd213a3..01501506 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 @@ -32,6 +32,7 @@ class CreatorChannelCommunityPostDetailResponseTest { assertTrue(detailJson["comments"]["hasNext"].asBoolean()) assertTrue(detailJson["comments"]["comments"][0].has("latestReply")) assertTrue(detailJson["comments"]["comments"][0].has("writerId")) + assertTrue(detailJson["comments"]["comments"][0]["isSecret"].asBoolean()) assertTrue(detailJson["comments"]["comments"][0]["latestReply"].has("commentId")) assertTrue(detailJson["comments"]["comments"][0]["latestReply"].has("writerId")) assertTrue(repliesJson["hasNext"].asBoolean()) @@ -75,6 +76,7 @@ class CreatorChannelCommunityPostDetailResponseTest { writerProfileImageUrl = "https://cdn.test/comment.png", writerNickname = "comment-writer", content = "comment", + isSecret = true, createdAt = LocalDateTime.of(2026, 7, 6, 3, 0), latestReply = reply )