diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/dto/CreatorChannelHomeResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/dto/CreatorChannelHomeResponse.kt index ad62d591..8859108a 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/dto/CreatorChannelHomeResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/dto/CreatorChannelHomeResponse.kt @@ -182,7 +182,9 @@ data class CreatorChannelCommunityPostResponse( val dateUtc: String, val existOrdered: Boolean, val likeCount: Int, - val commentCount: Int + val commentCount: Int, + @JsonProperty("isLiked") + val isLiked: Boolean ) { companion object { fun from(post: CreatorChannelCommunityPost): CreatorChannelCommunityPostResponse { @@ -198,7 +200,8 @@ data class CreatorChannelCommunityPostResponse( dateUtc = post.createdAt.toUtcIso(), existOrdered = post.existOrdered, likeCount = post.likeCount, - commentCount = post.commentCount + commentCount = post.commentCount, + isLiked = post.isLiked ) } } diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/adapter/in/web/CreatorChannelHomeControllerTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/adapter/in/web/CreatorChannelHomeControllerTest.kt index 74793e78..95b6ca33 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/adapter/in/web/CreatorChannelHomeControllerTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/adapter/in/web/CreatorChannelHomeControllerTest.kt @@ -135,6 +135,8 @@ class CreatorChannelHomeControllerTest @Autowired constructor( .andExpect(jsonPath("$.data.notices[0].dateUtc").value("2026-06-12T04:00:00Z")) .andExpect(jsonPath("$.data.notices[0].imageUrl").doesNotExist()) .andExpect(jsonPath("$.data.notices[0].audioUrl").doesNotExist()) + .andExpect(jsonPath("$.data.notices[0].isLiked").value(true)) + .andExpect(jsonPath("$.data.communities[0].isLiked").value(true)) .andExpect(jsonPath("$.data.series[0].isNew").value(true)) .andExpect(jsonPath("$.data.series[0].isOriginal").value(true)) @@ -171,7 +173,8 @@ class CreatorChannelHomeControllerTest @Autowired constructor( isCommentAvailable = true, likeCount = 2, commentCount = 3, - isPinned = true + isPinned = true, + isLiked = true ) return CreatorChannelHome( diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/application/CreatorChannelHomeFacadeTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/application/CreatorChannelHomeFacadeTest.kt index eddf9c56..3fc712f9 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/application/CreatorChannelHomeFacadeTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/api/creator/channel/home/application/CreatorChannelHomeFacadeTest.kt @@ -61,6 +61,7 @@ class CreatorChannelHomeFacadeTest { assertEquals(301L, response.notices.first().postId) assertEquals("2026-06-12T04:00:00Z", response.notices.first().dateUtc) assertNull(response.notices.first().imageUrl) + assertTrue(response.notices.first().isLiked) assertEquals(501L, response.schedules.first().targetId) assertEquals(202L, response.audioContents.first().audioContentId) assertFalse(response.audioContents.first().isOwned) @@ -69,6 +70,7 @@ class CreatorChannelHomeFacadeTest { assertTrue(response.series.first().isNew) assertTrue(response.series.first().isOriginal) assertEquals(302L, response.communities.first().postId) + assertTrue(response.communities.first().isLiked) assertEquals(701L, response.fanTalk.latestFanTalk?.fanTalkId) assertEquals("introduce", response.introduce) assertEquals(10, response.activity.liveCount) @@ -101,7 +103,8 @@ class CreatorChannelHomeFacadeTest { isCommentAvailable = true, likeCount = 2, commentCount = 3, - isPinned = true + isPinned = true, + isLiked = true ) return CreatorChannelHome( diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/home/application/CreatorChannelHomeQueryServiceTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/home/application/CreatorChannelHomeQueryServiceTest.kt index 836a4e72..e3a6e9dd 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/home/application/CreatorChannelHomeQueryServiceTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/home/application/CreatorChannelHomeQueryServiceTest.kt @@ -290,7 +290,8 @@ class CreatorChannelHomeQueryServiceTest { isCommentAvailable = true, likeCount = 2, commentCount = 3, - isPinned = true + isPinned = true, + isLiked = true ) return CreatorChannelHome( @@ -736,7 +737,8 @@ private class FakeCreatorChannelCommunityQueryPort : CreatorChannelCommunityQuer isCommentAvailable = true, likeCount = 3, commentCount = 4, - isPinned = isPinned + isPinned = isPinned, + isLiked = true ) ) }