큐레이션 - 조건 추가 #3

Merged
klaus merged 1 commits from test into main 2023-08-18 14:07:34 +00:00
1 changed files with 5 additions and 1 deletions

View File

@ -319,6 +319,9 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
isAdult: Boolean
): List<GetAudioContentMainItem> {
var where = audioContent.isActive.isTrue
.and(audioContent.member.isNotNull)
.and(audioContent.duration.isNotNull)
.and(audioContent.member.isActive.isTrue)
.and(audioContent.curation.id.eq(curationId))
if (!isAdult) {
@ -333,7 +336,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
audioContent.title,
audioContent.isAdult,
member.id,
member.profileImage.nullif("profile/default-profile.png")
member.profileImage
.prepend("/")
.prepend(cloudfrontHost),
member.nickname
@ -341,6 +344,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
)
.from(audioContent)
.innerJoin(audioContent.member, member)
.leftJoin(audioContent.curation, audioContentCuration)
.where(where)
.orderBy(audioContent.id.desc())
.fetch()