feat(recommend): 첫 오디오 콘텐츠 가격을 조회한다
This commit is contained in:
@@ -394,6 +394,7 @@ class DefaultHomeRecommendationQueryRepository(
|
||||
select ac.id as content_id,
|
||||
ac.member_id as creator_id,
|
||||
ac.title as title,
|
||||
ac.price as price,
|
||||
ac.cover_image as cover_image,
|
||||
ac.release_date as release_date,
|
||||
ac.is_active as is_active,
|
||||
@@ -422,6 +423,7 @@ class DefaultHomeRecommendationQueryRepository(
|
||||
m.nickname as creator_nickname,
|
||||
m.profile_image as creator_profile_image,
|
||||
ec.title as title,
|
||||
ec.price as price,
|
||||
ec.cover_image as cover_image,
|
||||
ec.release_date as release_date,
|
||||
ec.is_point_available as is_point_available,
|
||||
@@ -473,11 +475,12 @@ class DefaultHomeRecommendationQueryRepository(
|
||||
creatorNickname = row[2] as String,
|
||||
creatorProfileImage = row[3] as String?,
|
||||
title = row[4] as String,
|
||||
coverImage = row[5] as String?,
|
||||
releaseDate = toLocalDateTime(row[6]),
|
||||
isPointAvailable = row[7] as Boolean,
|
||||
recencyScore = (row[8] as Number).toInt(),
|
||||
randomTieBreaker = (row[9] as Number).toDouble()
|
||||
price = (row[5] as Number).toInt(),
|
||||
coverImage = row[6] as String?,
|
||||
releaseDate = toLocalDateTime(row[7]),
|
||||
isPointAvailable = row[8] as Boolean,
|
||||
recencyScore = (row[9] as Number).toInt(),
|
||||
randomTieBreaker = (row[10] as Number).toDouble()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ data class HomeFirstAudioContentRecord(
|
||||
val creatorNickname: String,
|
||||
val creatorProfileImage: String?,
|
||||
val title: String,
|
||||
val price: Int,
|
||||
val coverImage: String?,
|
||||
val releaseDate: LocalDateTime,
|
||||
val isPointAvailable: Boolean,
|
||||
|
||||
@@ -1042,7 +1042,7 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
||||
val excludedCreator = saveMember("first-audio-excluded", MemberRole.CREATOR)
|
||||
val eligibleInactive1 = saveAudioContent(eligibleCreator, now.minusDays(10), isActive = false)
|
||||
val eligibleInactive2 = saveAudioContent(eligibleCreator, now.minusDays(9), isActive = false)
|
||||
val eligibleActive = saveAudioContent(eligibleCreator, now.minusDays(2), isActive = true)
|
||||
val eligibleActive = saveAudioContent(eligibleCreator, now.minusDays(2), isActive = true, price = 12)
|
||||
val excludedInactive1 = saveAudioContent(excludedCreator, now.minusDays(10), isActive = false)
|
||||
val excludedInactive2 = saveAudioContent(excludedCreator, now.minusDays(9), isActive = false)
|
||||
val excludedInactive3 = saveAudioContent(excludedCreator, now.minusDays(8), isActive = false)
|
||||
@@ -1062,6 +1062,7 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
||||
|
||||
assertEquals(listOf(eligibleActive.id), contents.map { it.contentId })
|
||||
assertEquals(100, contents.single().recencyScore)
|
||||
assertEquals(12, contents.single().price)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1719,14 +1720,16 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
||||
isActive: Boolean,
|
||||
themeName: String = "theme-${creator.nickname}-$releaseDate",
|
||||
theme: AudioContentTheme = saveTheme(themeName),
|
||||
isAdult: Boolean = false
|
||||
isAdult: Boolean = false,
|
||||
price: Int = 0
|
||||
): AudioContent {
|
||||
val content = AudioContent(
|
||||
title = "content-${creator.nickname}-$releaseDate",
|
||||
detail = "detail",
|
||||
languageCode = "ko",
|
||||
releaseDate = releaseDate,
|
||||
isAdult = isAdult
|
||||
isAdult = isAdult,
|
||||
price = price
|
||||
)
|
||||
content.member = creator
|
||||
content.theme = theme
|
||||
|
||||
@@ -509,6 +509,7 @@ class HomeRecommendationQueryServiceTest {
|
||||
creatorNickname = "debut-creator",
|
||||
creatorProfileImage = "debut-profile.png",
|
||||
title = "first-audio",
|
||||
price = 10,
|
||||
coverImage = "first-audio.png",
|
||||
releaseDate = LocalDateTime.of(2026, 5, 30, 10, 0),
|
||||
isPointAvailable = true,
|
||||
|
||||
Reference in New Issue
Block a user