diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityTabResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityTabResponse.kt index d2920b97..3bc6a549 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityTabResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/community/dto/CreatorChannelCommunityTabResponse.kt @@ -42,7 +42,9 @@ data class CreatorChannelCommunityPostResponse( val likeCount: Int, val commentCount: Int, @JsonProperty("isPinned") - val isPinned: Boolean + val isPinned: Boolean, + @JsonProperty("isLiked") + val isLiked: Boolean ) { companion object { fun from(post: CreatorChannelCommunityPost): CreatorChannelCommunityPostResponse { @@ -60,7 +62,8 @@ data class CreatorChannelCommunityPostResponse( existOrdered = post.existOrdered, likeCount = post.likeCount, commentCount = post.commentCount, - isPinned = post.isPinned + isPinned = post.isPinned, + isLiked = post.isLiked ) } } 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 c987ebc4..a84b9746 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 @@ -102,6 +102,7 @@ class CreatorChannelCommunityControllerTest @Autowired constructor( .andExpect(jsonPath("$.data.communityPosts[0].existOrdered").value(true)) .andExpect(jsonPath("$.data.communityPosts[0].isCommentAvailable").value(true)) .andExpect(jsonPath("$.data.communityPosts[0].isPinned").value(true)) + .andExpect(jsonPath("$.data.communityPosts[0].isLiked").value(true)) .andExpect(jsonPath("$.data.page").value(1)) .andExpect(jsonPath("$.data.size").value(20)) .andExpect(jsonPath("$.data.hasNext").value(false)) @@ -184,7 +185,8 @@ class CreatorChannelCommunityControllerTest @Autowired constructor( existOrdered = true, likeCount = 7, commentCount = 3, - isPinned = true + isPinned = true, + isLiked = true ) ), page = page, 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 9eea1af3..1ce40cd4 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 @@ -39,6 +39,7 @@ class CreatorChannelCommunityFacadeTest { assertEquals(7, response.communityPosts.first().likeCount) assertEquals(3, response.communityPosts.first().commentCount) assertTrue(response.communityPosts.first().isPinned) + assertTrue(response.communityPosts.first().isLiked) assertNull(response.communityPosts.last().imageUrl) assertNull(response.communityPosts.last().audioUrl) assertEquals(1, response.page) @@ -50,6 +51,7 @@ class CreatorChannelCommunityFacadeTest { assertTrue(json["hasNext"].asBoolean()) assertTrue(json["communityPosts"][0]["isCommentAvailable"].asBoolean()) assertTrue(json["communityPosts"][0]["isPinned"].asBoolean()) + assertTrue(json["communityPosts"][0]["isLiked"].asBoolean()) } @Test @@ -112,7 +114,8 @@ class CreatorChannelCommunityFacadeTest { isCommentAvailable = true, likeCount = 7, commentCount = 3, - isPinned = true + isPinned = true, + isLiked = true ), CreatorChannelCommunityPost( postId = 102L, @@ -128,7 +131,8 @@ class CreatorChannelCommunityFacadeTest { isCommentAvailable = false, likeCount = 1, commentCount = 0, - isPinned = false + isPinned = false, + isLiked = false ) ), page = CreatorChannelPage(page = 1, size = 20),