test #426
@@ -390,6 +390,14 @@ class DefaultHomeRecommendationQueryRepository(
|
|||||||
ac.release_date as release_date,
|
ac.release_date as release_date,
|
||||||
ac.is_active as is_active,
|
ac.is_active as is_active,
|
||||||
ac.is_point_available as is_point_available,
|
ac.is_point_available as is_point_available,
|
||||||
|
ac.is_adult as is_adult,
|
||||||
|
exists (
|
||||||
|
select 1
|
||||||
|
from series_content csc
|
||||||
|
join series cs on cs.id = csc.series_id
|
||||||
|
where csc.content_id = ac.id
|
||||||
|
and cs.is_original = true
|
||||||
|
) as is_original_series,
|
||||||
row_number() over (
|
row_number() over (
|
||||||
partition by ac.member_id
|
partition by ac.member_id
|
||||||
order by ac.created_at asc, ac.release_date asc, ac.id asc
|
order by ac.created_at asc, ac.release_date asc, ac.id asc
|
||||||
@@ -416,7 +424,9 @@ class DefaultHomeRecommendationQueryRepository(
|
|||||||
ec.title as title,
|
ec.title as title,
|
||||||
ec.price as price,
|
ec.price as price,
|
||||||
ec.cover_image as cover_image,
|
ec.cover_image as cover_image,
|
||||||
ec.is_point_available as is_point_available
|
ec.is_point_available as is_point_available,
|
||||||
|
ec.is_adult as is_adult,
|
||||||
|
ec.is_original_series as is_original_series
|
||||||
from eligible_contents ec
|
from eligible_contents ec
|
||||||
join member m on m.id = ec.creator_id
|
join member m on m.id = ec.creator_id
|
||||||
join creator_debut cd on cd.creator_id = ec.creator_id
|
join creator_debut cd on cd.creator_id = ec.creator_id
|
||||||
@@ -465,7 +475,9 @@ class DefaultHomeRecommendationQueryRepository(
|
|||||||
title = row[4] as String,
|
title = row[4] as String,
|
||||||
price = (row[5] as Number).toInt(),
|
price = (row[5] as Number).toInt(),
|
||||||
coverImage = row[6] as String?,
|
coverImage = row[6] as String?,
|
||||||
isPointAvailable = row[7] as Boolean
|
isPointAvailable = row[7] as Boolean,
|
||||||
|
isAdult = row[8] as Boolean,
|
||||||
|
isOriginalSeries = row[9] as Boolean
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,9 @@ data class HomeFirstAudioContentRecord(
|
|||||||
val title: String,
|
val title: String,
|
||||||
val price: Int,
|
val price: Int,
|
||||||
val coverImage: String?,
|
val coverImage: String?,
|
||||||
val isPointAvailable: Boolean
|
val isPointAvailable: Boolean,
|
||||||
|
val isAdult: Boolean,
|
||||||
|
val isOriginalSeries: Boolean
|
||||||
)
|
)
|
||||||
|
|
||||||
data class HomeAiCharacterRecommendationRecord(
|
data class HomeAiCharacterRecommendationRecord(
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ class ContentOverviewPageResponseTest {
|
|||||||
title = "first audio",
|
title = "first audio",
|
||||||
price = 100,
|
price = 100,
|
||||||
coverImage = "cover/audio.png",
|
coverImage = "cover/audio.png",
|
||||||
isPointAvailable = true
|
isPointAvailable = true,
|
||||||
|
isAdult = true,
|
||||||
|
isOriginalSeries = true
|
||||||
),
|
),
|
||||||
coverImage = "https://cdn.test/cover/audio.png",
|
coverImage = "https://cdn.test/cover/audio.png",
|
||||||
isAdult = true,
|
isAdult = true,
|
||||||
|
|||||||
@@ -1164,6 +1164,25 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
|||||||
assertEquals(listOf(oldest.id), page1.map { it.contentId })
|
assertEquals(listOf(oldest.id), page1.map { it.contentId })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("첫 오디오 콘텐츠는 성인 여부와 오리지널 시리즈 여부를 함께 조회한다")
|
||||||
|
fun shouldMapFirstAudioContentAdultAndOriginalSeriesFlags() {
|
||||||
|
val now = LocalDateTime.of(2026, 5, 31, 10, 0)
|
||||||
|
val creator = saveMember("first-audio-flags", MemberRole.CREATOR)
|
||||||
|
val content = saveAudioContent(creator, now.minusDays(1), isActive = true, isAdult = false)
|
||||||
|
val series = saveSeries("first-audio-original-series", creator, isActive = true).apply {
|
||||||
|
isOriginal = true
|
||||||
|
}
|
||||||
|
saveSeriesContent(series, content)
|
||||||
|
updateCreatedAt("AudioContent", content.id!!, now.minusDays(1))
|
||||||
|
flushAndClear()
|
||||||
|
|
||||||
|
val contents = repository.findFirstAudioContents(now, limit = 10)
|
||||||
|
|
||||||
|
assertEquals(false, contents.single().isAdult)
|
||||||
|
assertEquals(true, contents.single().isOriginalSeries)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("첫 오디오 콘텐츠는 회원과 크리에이터의 양방향 차단 관계를 제외한다")
|
@DisplayName("첫 오디오 콘텐츠는 회원과 크리에이터의 양방향 차단 관계를 제외한다")
|
||||||
fun shouldExcludeBidirectionalBlockedCreatorsFromFirstAudioContents() {
|
fun shouldExcludeBidirectionalBlockedCreatorsFromFirstAudioContents() {
|
||||||
|
|||||||
@@ -688,7 +688,9 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
title = "first-audio",
|
title = "first-audio",
|
||||||
price = 10,
|
price = 10,
|
||||||
coverImage = "first-audio.png",
|
coverImage = "first-audio.png",
|
||||||
isPointAvailable = true
|
isPointAvailable = true,
|
||||||
|
isAdult = false,
|
||||||
|
isOriginalSeries = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
var aiCharacterDetails: List<HomeAiCharacterRecommendationRecord> = emptyList()
|
var aiCharacterDetails: List<HomeAiCharacterRecommendationRecord> = emptyList()
|
||||||
|
|||||||
Reference in New Issue
Block a user