feat(recommend): 인기 커뮤니티 게시글 가격을 조회한다
This commit is contained in:
@@ -778,6 +778,7 @@ class DefaultHomeRecommendationQueryRepository(
|
|||||||
creatorCommunity.imagePath,
|
creatorCommunity.imagePath,
|
||||||
creatorCommunity.audioPath,
|
creatorCommunity.audioPath,
|
||||||
creatorCommunity.content,
|
creatorCommunity.content,
|
||||||
|
creatorCommunity.price,
|
||||||
creatorCommunity.createdAt,
|
creatorCommunity.createdAt,
|
||||||
creatorCommunityLike.id.countDistinct(),
|
creatorCommunityLike.id.countDistinct(),
|
||||||
creatorCommunityComment.id.countDistinct(),
|
creatorCommunityComment.id.countDistinct(),
|
||||||
@@ -810,6 +811,7 @@ class DefaultHomeRecommendationQueryRepository(
|
|||||||
creatorCommunity.imagePath,
|
creatorCommunity.imagePath,
|
||||||
creatorCommunity.audioPath,
|
creatorCommunity.audioPath,
|
||||||
creatorCommunity.content,
|
creatorCommunity.content,
|
||||||
|
creatorCommunity.price,
|
||||||
creatorCommunity.createdAt
|
creatorCommunity.createdAt
|
||||||
)
|
)
|
||||||
.fetch()
|
.fetch()
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ data class HomePopularCommunityRecommendationRecord(
|
|||||||
val imagePath: String?,
|
val imagePath: String?,
|
||||||
val audioPath: String?,
|
val audioPath: String?,
|
||||||
val content: String,
|
val content: String,
|
||||||
|
val price: Int,
|
||||||
val createdAt: LocalDateTime,
|
val createdAt: LocalDateTime,
|
||||||
val likeCount: Long,
|
val likeCount: Long,
|
||||||
val commentCount: Long,
|
val commentCount: Long,
|
||||||
|
|||||||
@@ -1268,6 +1268,8 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
|||||||
assertEquals("content", detailById[eligible.id]!!.content)
|
assertEquals("content", detailById[eligible.id]!!.content)
|
||||||
assertEquals("community/detail-image.png", detailById[eligible.id]!!.imagePath)
|
assertEquals("community/detail-image.png", detailById[eligible.id]!!.imagePath)
|
||||||
assertEquals("community/detail-audio.mp3", detailById[eligible.id]!!.audioPath)
|
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(LocalDateTime.of(2026, 5, 29, 1, 0), detailById[eligible.id]!!.createdAt)
|
||||||
assertEquals(2L, detailById[eligible.id]!!.likeCount)
|
assertEquals(2L, detailById[eligible.id]!!.likeCount)
|
||||||
assertEquals(1L, detailById[eligible.id]!!.commentCount)
|
assertEquals(1L, detailById[eligible.id]!!.commentCount)
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
imagePath = "community-1.png",
|
imagePath = "community-1.png",
|
||||||
audioPath = "community-1.mp3",
|
audioPath = "community-1.mp3",
|
||||||
content = "content-1",
|
content = "content-1",
|
||||||
|
price = 10,
|
||||||
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0),
|
createdAt = LocalDateTime.of(2026, 5, 29, 1, 0),
|
||||||
likeCount = 3L,
|
likeCount = 3L,
|
||||||
commentCount = 2L,
|
commentCount = 2L,
|
||||||
@@ -243,6 +244,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
imagePath = null,
|
imagePath = null,
|
||||||
audioPath = null,
|
audioPath = null,
|
||||||
content = "content-2",
|
content = "content-2",
|
||||||
|
price = 0,
|
||||||
createdAt = LocalDateTime.of(2026, 5, 29, 2, 0),
|
createdAt = LocalDateTime.of(2026, 5, 29, 2, 0),
|
||||||
likeCount = 1L,
|
likeCount = 1L,
|
||||||
commentCount = 1L,
|
commentCount = 1L,
|
||||||
@@ -256,6 +258,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
imagePath = null,
|
imagePath = null,
|
||||||
audioPath = null,
|
audioPath = null,
|
||||||
content = "content-3",
|
content = "content-3",
|
||||||
|
price = 0,
|
||||||
createdAt = LocalDateTime.of(2026, 5, 29, 3, 0),
|
createdAt = LocalDateTime.of(2026, 5, 29, 3, 0),
|
||||||
likeCount = 0L,
|
likeCount = 0L,
|
||||||
commentCount = 0L,
|
commentCount = 0L,
|
||||||
@@ -296,6 +299,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
imagePath = null,
|
imagePath = null,
|
||||||
audioPath = null,
|
audioPath = null,
|
||||||
content = "content-$communityId",
|
content = "content-$communityId",
|
||||||
|
price = 0,
|
||||||
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user