fix(creator-channel): 오디오 탭 테마 조회 조건을 적용한다

This commit is contained in:
2026-06-19 21:44:34 +09:00
parent e5006d6334
commit 791ce2b8d3
3 changed files with 49 additions and 6 deletions

View File

@@ -69,17 +69,24 @@ class DefaultCreatorChannelAudioQueryRepository(
.fetchFirst()
}
override fun findAudioThemes(locale: String): List<CreatorChannelAudioThemeRecord> {
override fun findAudioThemes(
creatorId: Long,
now: LocalDateTime,
canViewAdultContent: Boolean,
locale: String
): List<CreatorChannelAudioThemeRecord> {
val themeTranslation = QContentThemeTranslation("audioThemeTranslation")
return queryFactory
.select(audioContentTheme.id, audioContentTheme.theme, themeTranslation.theme)
.from(audioContentTheme)
.select(audioContentTheme.id, audioContentTheme.theme, themeTranslation.theme, audioContentTheme.orders)
.distinct()
.from(audioContent)
.innerJoin(audioContent.theme, audioContentTheme)
.leftJoin(themeTranslation)
.on(
themeTranslation.contentThemeId.eq(audioContentTheme.id),
themeTranslation.locale.eq(locale)
)
.where(audioContentTheme.isActive.isTrue)
.where(audioContentCondition(creatorId, themeId = null, now, canViewAdultContent))
.orderBy(audioContentTheme.orders.asc(), audioContentTheme.id.asc())
.fetch()
.map {

View File

@@ -11,7 +11,12 @@ interface CreatorChannelAudioQueryPort {
fun findActiveThemeId(themeId: Long): Long?
fun findAudioThemes(locale: String): List<CreatorChannelAudioThemeRecord>
fun findAudioThemes(
creatorId: Long,
now: LocalDateTime,
canViewAdultContent: Boolean,
locale: String
): List<CreatorChannelAudioThemeRecord>
fun countAudioContents(
creatorId: Long,