feat(recommend): 인기 커뮤니티 게시글 가격을 조회한다

This commit is contained in:
2026-06-01 23:11:31 +09:00
parent bc349d5881
commit 6d399c48ab
4 changed files with 9 additions and 0 deletions

View File

@@ -778,6 +778,7 @@ class DefaultHomeRecommendationQueryRepository(
creatorCommunity.imagePath,
creatorCommunity.audioPath,
creatorCommunity.content,
creatorCommunity.price,
creatorCommunity.createdAt,
creatorCommunityLike.id.countDistinct(),
creatorCommunityComment.id.countDistinct(),
@@ -810,6 +811,7 @@ class DefaultHomeRecommendationQueryRepository(
creatorCommunity.imagePath,
creatorCommunity.audioPath,
creatorCommunity.content,
creatorCommunity.price,
creatorCommunity.createdAt
)
.fetch()

View File

@@ -154,6 +154,7 @@ data class HomePopularCommunityRecommendationRecord(
val imagePath: String?,
val audioPath: String?,
val content: String,
val price: Int,
val createdAt: LocalDateTime,
val likeCount: Long,
val commentCount: Long,

View File

@@ -1268,6 +1268,8 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
assertEquals("content", detailById[eligible.id]!!.content)
assertEquals("community/detail-image.png", detailById[eligible.id]!!.imagePath)
assertEquals("community/detail-audio.mp3", detailById[eligible.id]!!.audioPath)
assertEquals(0, detailById[eligible.id]!!.price)
assertEquals(10, detailById[paid.id]!!.price)
assertEquals(LocalDateTime.of(2026, 5, 29, 1, 0), detailById[eligible.id]!!.createdAt)
assertEquals(2L, detailById[eligible.id]!!.likeCount)
assertEquals(1L, detailById[eligible.id]!!.commentCount)

View File

@@ -230,6 +230,7 @@ class HomeRecommendationQueryServiceTest {
imagePath = "community-1.png",
audioPath = "community-1.mp3",
content = "content-1",
price = 10,
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0),
likeCount = 3L,
commentCount = 2L,
@@ -243,6 +244,7 @@ class HomeRecommendationQueryServiceTest {
imagePath = null,
audioPath = null,
content = "content-2",
price = 0,
createdAt = LocalDateTime.of(2026, 5, 29, 2, 0),
likeCount = 1L,
commentCount = 1L,
@@ -256,6 +258,7 @@ class HomeRecommendationQueryServiceTest {
imagePath = null,
audioPath = null,
content = "content-3",
price = 0,
createdAt = LocalDateTime.of(2026, 5, 29, 3, 0),
likeCount = 0L,
commentCount = 0L,
@@ -296,6 +299,7 @@ class HomeRecommendationQueryServiceTest {
imagePath = null,
audioPath = null,
content = "content-$communityId",
price = 0,
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0).plusMinutes(communityId),
likeCount = 0L,
commentCount = 0L,