오디오 콘텐츠 예약 업로드
- 예약 업로드 한 콘텐츠 release와 푸시발송 로직 추가
This commit is contained in:
@@ -25,7 +25,10 @@ import java.time.temporal.TemporalAdjusters
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/audio-content")
|
||||
class AudioContentController(private val service: AudioContentService) {
|
||||
class AudioContentController(
|
||||
private val service: AudioContentService,
|
||||
private val repository: AudioContentRepository
|
||||
) {
|
||||
@PostMapping
|
||||
@PreAuthorize("hasRole('CREATOR')")
|
||||
fun createAudioContent(
|
||||
@@ -190,4 +193,16 @@ class AudioContentController(private val service: AudioContentService) {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@PostMapping("/release")
|
||||
@PreAuthorize("hasRole('BOT')")
|
||||
fun releaseContent() = run {
|
||||
val contentIdList = repository.getNotReleaseContentId()
|
||||
|
||||
contentIdList.forEach {
|
||||
service.releaseContent(it)
|
||||
}
|
||||
|
||||
ApiResponse.ok(null)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user