feat(content-theme): 무료 콘텐츠의 테마를 조회할 때 '자기소개'가 가장 먼저 표시되도록 수정

This commit is contained in:
2025-11-21 00:37:29 +09:00
parent 9a58b7b95f
commit 39c51825da

View File

@@ -64,15 +64,24 @@ class AudioContentThemeQueryRepository(
where = where.and(audioContent.isPointAvailable.isTrue) where = where.and(audioContent.isPointAvailable.isTrue)
} }
return queryFactory val query = queryFactory
.select(audioContentTheme.theme) .select(audioContentTheme.theme)
.from(audioContent) .from(audioContent)
.innerJoin(audioContent.member, member) .innerJoin(audioContent.member, member)
.innerJoin(audioContent.theme, audioContentTheme) .innerJoin(audioContent.theme, audioContentTheme)
.where(where) .where(where)
.groupBy(audioContentTheme.id) .groupBy(audioContentTheme.id)
.orderBy(audioContentTheme.orders.asc())
.fetch() if (isFree) {
query.orderBy(
audioContentTheme.theme.eq("자기소개").desc(),
audioContentTheme.orders.asc()
)
} else {
query.orderBy(audioContentTheme.orders.asc())
}
return query.fetch()
} }
fun findThemeByIdAndActive(id: Long): AudioContentTheme? { fun findThemeByIdAndActive(id: Long): AudioContentTheme? {