parent
05592f94b9
commit
e0d48712ac
|
@ -120,7 +120,7 @@ interface AudioContentQueryRepository {
|
|||
|
||||
fun getAudioContentCurationList(isAdult: Boolean, offset: Long, limit: Long): List<AudioContentCuration>
|
||||
|
||||
fun getNotReleaseContentId(): List<Long>
|
||||
fun getNotReleaseContent(): List<AudioContent>
|
||||
|
||||
fun isContentCreator(contentId: Long, memberId: Long): Boolean
|
||||
|
||||
|
@ -762,15 +762,14 @@ class AudioContentQueryRepositoryImpl(
|
|||
.fetch()
|
||||
}
|
||||
|
||||
override fun getNotReleaseContentId(): List<Long> {
|
||||
override fun getNotReleaseContent(): List<AudioContent> {
|
||||
val where = audioContent.isActive.isFalse
|
||||
.and(audioContent.releaseDate.isNotNull)
|
||||
.and(audioContent.releaseDate.loe(LocalDateTime.now()))
|
||||
.and(audioContent.duration.isNotNull)
|
||||
|
||||
return queryFactory
|
||||
.select(audioContent.id)
|
||||
.from(audioContent)
|
||||
.selectFrom(audioContent)
|
||||
.where(where)
|
||||
.fetch()
|
||||
}
|
||||
|
|
|
@ -406,12 +406,9 @@ class AudioContentService(
|
|||
@SchedulerOnly
|
||||
@Transactional
|
||||
fun releaseContent() {
|
||||
val contentIdList = repository.getNotReleaseContentId()
|
||||
|
||||
for (contentId in contentIdList) {
|
||||
val audioContent = repository.findByIdOrNull(contentId)
|
||||
?: throw SodaException("잘못된 요청입니다.")
|
||||
val notReleasedAudioContent = repository.getNotReleaseContent()
|
||||
|
||||
for (audioContent in notReleasedAudioContent) {
|
||||
audioContent.isActive = true
|
||||
|
||||
applicationEventPublisher.publishEvent(
|
||||
|
@ -420,7 +417,7 @@ class AudioContentService(
|
|||
title = audioContent.member!!.nickname,
|
||||
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
|
||||
isAuth = audioContent.isAdult,
|
||||
contentId = contentId,
|
||||
contentId = audioContent.id!!,
|
||||
creatorId = audioContent.member!!.id,
|
||||
container = "ios"
|
||||
)
|
||||
|
@ -432,7 +429,7 @@ class AudioContentService(
|
|||
title = audioContent.member!!.nickname,
|
||||
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
|
||||
isAuth = audioContent.isAdult,
|
||||
contentId = contentId,
|
||||
contentId = audioContent.id!!,
|
||||
creatorId = audioContent.member!!.id,
|
||||
container = "aos"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue