오디오 콘텐츠 예약 업로드

- 예약 업로드 한 콘텐츠 release와 푸시발송 로직 추가
This commit is contained in:
2024-01-10 21:45:44 +09:00
parent ca2cc7a6b6
commit e007a95982
3 changed files with 64 additions and 2 deletions

View File

@@ -342,7 +342,6 @@ class AudioContentService(
val audioContent = repository.findByIdOrNull(contentId)
?: throw SodaException("잘못된 요청입니다.")
audioContent.isActive = true
audioContent.content = content
audioContent.duration = duration
@@ -358,6 +357,8 @@ class AudioContentService(
)
if (audioContent.releaseDate == null) {
audioContent.isActive = true
applicationEventPublisher.publishEvent(
FcmEvent(
type = FcmEventType.UPLOAD_CONTENT,
@@ -384,6 +385,38 @@ class AudioContentService(
}
}
@Transactional
fun releaseContent(contentId: Long) {
val audioContent = repository.findByIdOrNull(contentId)
?: throw SodaException("잘못된 요청입니다.")
audioContent.isActive = true
applicationEventPublisher.publishEvent(
FcmEvent(
type = FcmEventType.UPLOAD_CONTENT,
title = audioContent.member!!.nickname,
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
isAuth = audioContent.isAdult,
contentId = contentId,
creatorId = audioContent.member!!.id,
container = "ios"
)
)
applicationEventPublisher.publishEvent(
FcmEvent(
type = FcmEventType.UPLOAD_CONTENT,
title = audioContent.member!!.nickname,
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
isAuth = audioContent.isAdult,
contentId = contentId,
creatorId = audioContent.member!!.id,
container = "aos"
)
)
}
fun getDetail(id: Long, member: Member, timezone: String): GetAudioContentDetailResponse {
// 묶음 콘텐츠 조회
val bundleAudioContentList = repository.findBundleByContentId(contentId = id)