예약 업로드 배포 로직 위치 이동
This commit is contained in:
parent
3e8476431d
commit
afe529a116
|
@ -25,10 +25,7 @@ import java.time.temporal.TemporalAdjusters
|
|||
|
||||
@RestController
|
||||
@RequestMapping("/audio-content")
|
||||
class AudioContentController(
|
||||
private val service: AudioContentService,
|
||||
private val repository: AudioContentRepository
|
||||
) {
|
||||
class AudioContentController(private val service: AudioContentService) {
|
||||
@PostMapping
|
||||
@PreAuthorize("hasRole('CREATOR')")
|
||||
fun createAudioContent(
|
||||
|
@ -197,12 +194,6 @@ class AudioContentController(
|
|||
@PostMapping("/release")
|
||||
@PreAuthorize("hasRole('BOT')")
|
||||
fun releaseContent() = run {
|
||||
val contentIdList = repository.getNotReleaseContentId()
|
||||
|
||||
for (contentId in contentIdList) {
|
||||
service.releaseContent(contentId)
|
||||
}
|
||||
|
||||
ApiResponse.ok(null)
|
||||
ApiResponse.ok(service.releaseContent())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -387,7 +387,10 @@ class AudioContentService(
|
|||
}
|
||||
|
||||
@Transactional
|
||||
fun releaseContent(contentId: Long) {
|
||||
fun releaseContent() {
|
||||
val contentIdList = repository.getNotReleaseContentId()
|
||||
|
||||
for (contentId in contentIdList) {
|
||||
val audioContent = repository.findByIdOrNull(contentId)
|
||||
?: throw SodaException("잘못된 요청입니다.")
|
||||
|
||||
|
@ -417,6 +420,7 @@ class AudioContentService(
|
|||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun getDetail(id: Long, member: Member, timezone: String): GetAudioContentDetailResponse {
|
||||
// 묶음 콘텐츠 조회
|
||||
|
|
Loading…
Reference in New Issue