From 1ec7a6f096d2486bf8dae04464df259b380dbf7d Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 24 Jan 2024 23:58:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=98=ED=85=90=EC=B8=A0=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=20=EA=B8=B0=EC=A4=80=20-=20AS-IS=20:=20=EC=98=AC?= =?UTF-8?q?=EB=A6=B0=20=EC=88=9C=EC=84=9C=20=EA=B8=B0=EC=A4=80=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=20(=20created=5Fat=20)=20-=20TO-BE=20:=20=EB=A6=B4?= =?UTF-8?q?=EB=A6=AC=EC=A6=88=20=EC=88=9C=EC=84=9C=20=EA=B8=B0=EC=A4=80=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC=20(=20release=5Fdate=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/content/AudioContentRepository.kt | 12 ++++++------ .../sodalive/content/AudioContentService.kt | 2 +- .../admin/content/CreatorAdminContentRepository.kt | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt index 15a1427..2966970 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt @@ -145,7 +145,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) limit: Long ): List { val orderBy = when (sortType) { - SortType.NEWEST -> audioContent.createdAt.desc() + SortType.NEWEST -> audioContent.releaseDate.desc() SortType.PRICE_HIGH -> audioContent.price.desc() SortType.PRICE_LOW -> audioContent.price.asc() } @@ -290,13 +290,13 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) .where(where) .offset(offset) .limit(limit) - .orderBy(audioContent.createdAt.desc()) + .orderBy(audioContent.releaseDate.desc()) .fetch() } override fun totalCountNewContentFor2Weeks(theme: String, memberId: Long, isAdult: Boolean): Int { var where = audioContent.isActive.isTrue - .and(audioContent.createdAt.goe(LocalDateTime.now().minusWeeks(2))) + .and(audioContent.releaseDate.goe(LocalDateTime.now().minusWeeks(2))) .and( audioContent.releaseDate.isNull .or(audioContent.releaseDate.loe(LocalDateTime.now())) @@ -330,7 +330,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) limit: Long ): List { var where = audioContent.isActive.isTrue - .and(audioContent.createdAt.goe(LocalDateTime.now().minusWeeks(2))) + .and(audioContent.releaseDate.goe(LocalDateTime.now().minusWeeks(2))) .and( audioContent.releaseDate.isNull .or(audioContent.releaseDate.loe(LocalDateTime.now())) @@ -362,7 +362,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) .where(where) .offset(offset) .limit(limit) - .orderBy(audioContent.createdAt.desc()) + .orderBy(audioContent.releaseDate.desc()) .fetch() } @@ -370,7 +370,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) cloudfrontHost: String, isAdult: Boolean ): List { - var where = audioContent.createdAt.after(LocalDateTime.now().minusWeeks(2)) + var where = audioContent.releaseDate.after(LocalDateTime.now().minusWeeks(2)) .and(audioContent.isActive.isTrue) if (!isAdult) { diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt index 8e4efdb..11ae487 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt @@ -151,7 +151,7 @@ class AudioContentService( .withZoneSameInstant(ZoneId.of("UTC")) .toLocalDateTime() } else { - null + LocalDateTime.now() } // contentFile 체크 diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/content/CreatorAdminContentRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/content/CreatorAdminContentRepository.kt index 3cb2364..e856992 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/content/CreatorAdminContentRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/content/CreatorAdminContentRepository.kt @@ -94,7 +94,7 @@ class CreatorAdminAudioContentQueryRepositoryImpl( .where(where) .offset(offset) .limit(limit) - .orderBy(audioContent.id.desc()) + .orderBy(audioContent.releaseDate.desc()) .fetch() }