feat(home): 인기 커뮤니티 좋아요 응답을 추가한다

This commit is contained in:
2026-06-30 01:08:25 +09:00
parent 6c2c8a0386
commit 2789670615
4 changed files with 19 additions and 8 deletions

View File

@@ -305,7 +305,8 @@ class HomeRecommendationFacade(
createdAt = createdAt.toUtcIso(),
likeCount = likeCount,
commentCount = commentCount,
existOrdered = existOrdered
existOrdered = existOrdered,
isLiked = isLiked
)
companion object {

View File

@@ -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
)

View File

@@ -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)

View File

@@ -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
)
}