fix(creator-channel): 오디오 탭 테마 조회 조건을 적용한다
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user