새로운 콘텐츠 - 최근 2주 데이터만 불러오도록 수정

This commit is contained in:
Klaus 2023-09-27 15:42:20 +09:00
parent ba491420f5
commit ffdcd61894
1 changed files with 2 additions and 2 deletions

View File

@ -263,7 +263,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
override fun totalCountNewContentFor2Weeks(theme: String, isAdult: Boolean): Int {
var where = audioContent.isActive.isTrue
.and(audioContent.createdAt.loe(LocalDateTime.now()))
.and(audioContent.createdAt.goe(LocalDateTime.now().minusWeeks(2)))
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)
@ -291,7 +291,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
limit: Long
): List<GetAudioContentMainItem> {
var where = audioContent.isActive.isTrue
.and(audioContent.createdAt.loe(LocalDateTime.now()))
.and(audioContent.createdAt.goe(LocalDateTime.now().minusWeeks(2)))
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)