feat(channel): 채널 홈 좋아요 응답을 추가한다

This commit is contained in:
2026-06-30 01:11:37 +09:00
parent 502d5d9996
commit 816f23ebcc
4 changed files with 17 additions and 6 deletions

View File

@@ -182,7 +182,9 @@ data class CreatorChannelCommunityPostResponse(
val dateUtc: String, val dateUtc: String,
val existOrdered: Boolean, val existOrdered: Boolean,
val likeCount: Int, val likeCount: Int,
val commentCount: Int val commentCount: Int,
@JsonProperty("isLiked")
val isLiked: Boolean
) { ) {
companion object { companion object {
fun from(post: CreatorChannelCommunityPost): CreatorChannelCommunityPostResponse { fun from(post: CreatorChannelCommunityPost): CreatorChannelCommunityPostResponse {
@@ -198,7 +200,8 @@ data class CreatorChannelCommunityPostResponse(
dateUtc = post.createdAt.toUtcIso(), dateUtc = post.createdAt.toUtcIso(),
existOrdered = post.existOrdered, existOrdered = post.existOrdered,
likeCount = post.likeCount, likeCount = post.likeCount,
commentCount = post.commentCount commentCount = post.commentCount,
isLiked = post.isLiked
) )
} }
} }

View File

@@ -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].dateUtc").value("2026-06-12T04:00:00Z"))
.andExpect(jsonPath("$.data.notices[0].imageUrl").doesNotExist()) .andExpect(jsonPath("$.data.notices[0].imageUrl").doesNotExist())
.andExpect(jsonPath("$.data.notices[0].audioUrl").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].isNew").value(true))
.andExpect(jsonPath("$.data.series[0].isOriginal").value(true)) .andExpect(jsonPath("$.data.series[0].isOriginal").value(true))
@@ -171,7 +173,8 @@ class CreatorChannelHomeControllerTest @Autowired constructor(
isCommentAvailable = true, isCommentAvailable = true,
likeCount = 2, likeCount = 2,
commentCount = 3, commentCount = 3,
isPinned = true isPinned = true,
isLiked = true
) )
return CreatorChannelHome( return CreatorChannelHome(

View File

@@ -61,6 +61,7 @@ class CreatorChannelHomeFacadeTest {
assertEquals(301L, response.notices.first().postId) assertEquals(301L, response.notices.first().postId)
assertEquals("2026-06-12T04:00:00Z", response.notices.first().dateUtc) assertEquals("2026-06-12T04:00:00Z", response.notices.first().dateUtc)
assertNull(response.notices.first().imageUrl) assertNull(response.notices.first().imageUrl)
assertTrue(response.notices.first().isLiked)
assertEquals(501L, response.schedules.first().targetId) assertEquals(501L, response.schedules.first().targetId)
assertEquals(202L, response.audioContents.first().audioContentId) assertEquals(202L, response.audioContents.first().audioContentId)
assertFalse(response.audioContents.first().isOwned) assertFalse(response.audioContents.first().isOwned)
@@ -69,6 +70,7 @@ class CreatorChannelHomeFacadeTest {
assertTrue(response.series.first().isNew) assertTrue(response.series.first().isNew)
assertTrue(response.series.first().isOriginal) assertTrue(response.series.first().isOriginal)
assertEquals(302L, response.communities.first().postId) assertEquals(302L, response.communities.first().postId)
assertTrue(response.communities.first().isLiked)
assertEquals(701L, response.fanTalk.latestFanTalk?.fanTalkId) assertEquals(701L, response.fanTalk.latestFanTalk?.fanTalkId)
assertEquals("introduce", response.introduce) assertEquals("introduce", response.introduce)
assertEquals(10, response.activity.liveCount) assertEquals(10, response.activity.liveCount)
@@ -101,7 +103,8 @@ class CreatorChannelHomeFacadeTest {
isCommentAvailable = true, isCommentAvailable = true,
likeCount = 2, likeCount = 2,
commentCount = 3, commentCount = 3,
isPinned = true isPinned = true,
isLiked = true
) )
return CreatorChannelHome( return CreatorChannelHome(

View File

@@ -290,7 +290,8 @@ class CreatorChannelHomeQueryServiceTest {
isCommentAvailable = true, isCommentAvailable = true,
likeCount = 2, likeCount = 2,
commentCount = 3, commentCount = 3,
isPinned = true isPinned = true,
isLiked = true
) )
return CreatorChannelHome( return CreatorChannelHome(
@@ -736,7 +737,8 @@ private class FakeCreatorChannelCommunityQueryPort : CreatorChannelCommunityQuer
isCommentAvailable = true, isCommentAvailable = true,
likeCount = 3, likeCount = 3,
commentCount = 4, commentCount = 4,
isPinned = isPinned isPinned = isPinned,
isLiked = true
) )
) )
} }