feat(home): 인기 커뮤니티 좋아요 응답을 추가한다
This commit is contained in:
@@ -305,7 +305,8 @@ class HomeRecommendationFacade(
|
|||||||
createdAt = createdAt.toUtcIso(),
|
createdAt = createdAt.toUtcIso(),
|
||||||
likeCount = likeCount,
|
likeCount = likeCount,
|
||||||
commentCount = commentCount,
|
commentCount = commentCount,
|
||||||
existOrdered = existOrdered
|
existOrdered = existOrdered,
|
||||||
|
isLiked = isLiked
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -88,5 +88,7 @@ data class HomePopularCommunityPostItem(
|
|||||||
val createdAt: String,
|
val createdAt: String,
|
||||||
val likeCount: Long,
|
val likeCount: Long,
|
||||||
val commentCount: Long,
|
val commentCount: Long,
|
||||||
val existOrdered: Boolean
|
val existOrdered: Boolean,
|
||||||
|
@JsonProperty("isLiked")
|
||||||
|
val isLiked: Boolean
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ class HomeRecommendationResponseTest {
|
|||||||
createdAt = "2026-06-01T00:00:00Z",
|
createdAt = "2026-06-01T00:00:00Z",
|
||||||
likeCount = 7L,
|
likeCount = 7L,
|
||||||
commentCount = 8L,
|
commentCount = 8L,
|
||||||
existOrdered = true
|
existOrdered = true,
|
||||||
|
isLiked = true
|
||||||
),
|
),
|
||||||
HomePopularCommunityPostItem(
|
HomePopularCommunityPostItem(
|
||||||
postId = 9L,
|
postId = 9L,
|
||||||
@@ -86,7 +87,8 @@ class HomeRecommendationResponseTest {
|
|||||||
createdAt = "2026-06-01T00:00:00Z",
|
createdAt = "2026-06-01T00:00:00Z",
|
||||||
likeCount = 0L,
|
likeCount = 0L,
|
||||||
commentCount = 0L,
|
commentCount = 0L,
|
||||||
existOrdered = false
|
existOrdered = false,
|
||||||
|
isLiked = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -111,6 +113,7 @@ class HomeRecommendationResponseTest {
|
|||||||
assertEquals("https://cdn.test/community/audio.mp3", json["popularCommunityPosts"][0]["audioUrl"].asText())
|
assertEquals("https://cdn.test/community/audio.mp3", json["popularCommunityPosts"][0]["audioUrl"].asText())
|
||||||
assertEquals(9, json["popularCommunityPosts"][0]["price"].asInt())
|
assertEquals(9, json["popularCommunityPosts"][0]["price"].asInt())
|
||||||
assertEquals(true, json["popularCommunityPosts"][0]["existOrdered"].asBoolean())
|
assertEquals(true, json["popularCommunityPosts"][0]["existOrdered"].asBoolean())
|
||||||
|
assertEquals(true, json["popularCommunityPosts"][0]["isLiked"].asBoolean())
|
||||||
assertEquals(true, json["popularCommunityPosts"][1]["creatorProfileImage"].isNull)
|
assertEquals(true, json["popularCommunityPosts"][1]["creatorProfileImage"].isNull)
|
||||||
assertEquals(true, json["popularCommunityPosts"][1]["imageUrl"].isNull)
|
assertEquals(true, json["popularCommunityPosts"][1]["imageUrl"].isNull)
|
||||||
assertEquals(true, json["popularCommunityPosts"][1]["audioUrl"].isNull)
|
assertEquals(true, json["popularCommunityPosts"][1]["audioUrl"].isNull)
|
||||||
|
|||||||
@@ -245,7 +245,8 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0),
|
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0),
|
||||||
likeCount = 3L,
|
likeCount = 3L,
|
||||||
commentCount = 2L,
|
commentCount = 2L,
|
||||||
existOrdered = true
|
existOrdered = true,
|
||||||
|
isLiked = true
|
||||||
),
|
),
|
||||||
HomePopularCommunityRecommendationRecord(
|
HomePopularCommunityRecommendationRecord(
|
||||||
communityId = 2L,
|
communityId = 2L,
|
||||||
@@ -259,7 +260,8 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
createdAt = LocalDateTime.of(2026, 5, 29, 2, 0),
|
createdAt = LocalDateTime.of(2026, 5, 29, 2, 0),
|
||||||
likeCount = 1L,
|
likeCount = 1L,
|
||||||
commentCount = 1L,
|
commentCount = 1L,
|
||||||
existOrdered = false
|
existOrdered = false,
|
||||||
|
isLiked = false
|
||||||
),
|
),
|
||||||
HomePopularCommunityRecommendationRecord(
|
HomePopularCommunityRecommendationRecord(
|
||||||
communityId = 3L,
|
communityId = 3L,
|
||||||
@@ -273,7 +275,8 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
createdAt = LocalDateTime.of(2026, 5, 29, 3, 0),
|
createdAt = LocalDateTime.of(2026, 5, 29, 3, 0),
|
||||||
likeCount = 0L,
|
likeCount = 0L,
|
||||||
commentCount = 0L,
|
commentCount = 0L,
|
||||||
existOrdered = false
|
existOrdered = false,
|
||||||
|
isLiked = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -288,6 +291,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
assertEquals("community-1.png", communities.first().imagePath)
|
assertEquals("community-1.png", communities.first().imagePath)
|
||||||
assertEquals("community-1.mp3", communities.first().audioPath)
|
assertEquals("community-1.mp3", communities.first().audioPath)
|
||||||
assertEquals(true, communities.first().existOrdered)
|
assertEquals(true, communities.first().existOrdered)
|
||||||
|
assertEquals(true, communities.first().isLiked)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -314,7 +318,8 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0).plusMinutes(communityId),
|
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0).plusMinutes(communityId),
|
||||||
likeCount = 0L,
|
likeCount = 0L,
|
||||||
commentCount = 0L,
|
commentCount = 0L,
|
||||||
existOrdered = false
|
existOrdered = false,
|
||||||
|
isLiked = false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user