feat(community): 커뮤니티 탭 좋아요 응답을 추가한다
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user