Compare commits

...

3 Commits

Author SHA1 Message Date
klaus a999dd2085 Merge pull request 'test' (#136) from test into main
Reviewed-on: #136
2024-02-27 16:16:30 +00:00
Klaus 2f08149e48 룰렛 정렬 순서 수정
1순위 - 활성화 된 상태
2순위 - id
2024-02-28 01:09:42 +09:00
Klaus 48d5f1674f 크리에이터 콘텐츠 조회
- 재생시간이 있는 콘텐츠만 조회되도록 수정
2024-02-27 17:19:49 +09:00
2 changed files with 9 additions and 2 deletions

View File

@ -166,6 +166,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
var where = audioContent.member.id.eq(creatorId)
.and(
audioContent.isActive.isTrue
.and(audioContent.duration.isNotNull)
.or(audioContent.releaseDate.isNotNull.and(audioContent.duration.isNotNull))
)
@ -237,6 +238,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
var where = audioContent.member.id.eq(creatorId)
.and(
audioContent.isActive.isTrue
.and(audioContent.duration.isNotNull)
.or(audioContent.releaseDate.isNotNull.and(audioContent.duration.isNotNull))
)
@ -336,6 +338,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
}
var where = audioContent.isActive.isTrue
.and(audioContent.duration.isNotNull)
.and(
audioContent.releaseDate.isNull
.or(audioContent.releaseDate.loe(LocalDateTime.now()))
@ -375,6 +378,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
override fun totalCountByTheme(memberId: Long, theme: String, isAdult: Boolean): Int {
var where = audioContent.isActive.isTrue
.and(audioContent.duration.isNotNull)
.and(
audioContent.releaseDate.isNull
.or(audioContent.releaseDate.loe(LocalDateTime.now()))
@ -401,6 +405,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
override fun totalCountNewContentFor2Weeks(theme: String, memberId: Long, isAdult: Boolean): Int {
var where = audioContent.isActive.isTrue
.and(audioContent.duration.isNotNull)
.and(audioContent.releaseDate.goe(LocalDateTime.now().minusWeeks(2)))
.and(
audioContent.releaseDate.isNull
@ -435,6 +440,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
limit: Long
): List<GetAudioContentMainItem> {
var where = audioContent.isActive.isTrue
.and(audioContent.duration.isNotNull)
.and(audioContent.releaseDate.goe(LocalDateTime.now().minusWeeks(2)))
.and(
audioContent.releaseDate.isNull
@ -479,6 +485,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
): List<GetNewContentUploadCreator> {
var where = audioContent.releaseDate.after(LocalDateTime.now().minusWeeks(2))
.and(audioContent.isActive.isTrue)
.and(audioContent.duration.isNotNull)
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)

View File

@ -54,9 +54,9 @@ class NewRouletteService(
oldRepository.deleteById(roulette.creatorId)
}
}
rouletteList.sortedBy { it.id }
return rouletteList.asSequence()
return rouletteList.sortedWith(compareByDescending<NewRoulette> { it.isActive }.thenBy { it.id })
.asSequence()
.map {
GetNewRouletteResponse(
it.id,