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