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