| @@ -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 { | ||||
|         // 묶음 콘텐츠 조회 | ||||
|   | ||||
| @@ -5,7 +5,7 @@ data class CreateAudioContentRequest( | ||||
|     val detail: String, | ||||
|     val tags: String, | ||||
|     val price: Int, | ||||
|     val timezone: String, | ||||
|     val timezone: String = "Asia/Seoul", | ||||
|     val releaseDate: String? = null, | ||||
|     val themeId: Long = 0, | ||||
|     val isAdult: Boolean = false, | ||||
|   | ||||
| @@ -186,6 +186,7 @@ class FcmSendListener( | ||||
|             FcmEventType.SEND_MESSAGE -> { | ||||
|                 val response = memberRepository.getMessageRecipientPushToken(messageId = fcmEvent.messageId!!) | ||||
|  | ||||
|                 if (response != null) { | ||||
|                     pushService.send( | ||||
|                         tokens = listOf(response.pushToken), | ||||
|                         title = fcmEvent.title, | ||||
| @@ -194,6 +195,7 @@ class FcmSendListener( | ||||
|                         messageId = fcmEvent.messageId | ||||
|                     ) | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             FcmEventType.CHANGE_NOTICE -> { | ||||
|                 if (fcmEvent.creatorId != null) { | ||||
|   | ||||
| @@ -45,7 +45,7 @@ interface MemberQueryRepository { | ||||
|         container: String | ||||
|     ): List<List<String>> | ||||
|  | ||||
|     fun getMessageRecipientPushToken(messageId: Long): GetMessageRecipientPushTokenResponse | ||||
|     fun getMessageRecipientPushToken(messageId: Long): GetMessageRecipientPushTokenResponse? | ||||
|     fun getIndividualRecipientPushTokens(recipients: List<Long>, isAuth: Boolean?): Map<String, List<List<String>>> | ||||
|     fun getChangeNicknamePrice(memberId: Long): GetChangeNicknamePriceResponse | ||||
|     fun getMemberByEmail(email: String): Member? | ||||
| @@ -259,7 +259,7 @@ class MemberQueryRepositoryImpl( | ||||
|             .chunked(500) | ||||
|     } | ||||
|  | ||||
|     override fun getMessageRecipientPushToken(messageId: Long): GetMessageRecipientPushTokenResponse { | ||||
|     override fun getMessageRecipientPushToken(messageId: Long): GetMessageRecipientPushTokenResponse? { | ||||
|         return queryFactory | ||||
|             .select( | ||||
|                 QGetMessageRecipientPushTokenResponse( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user