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