Compare commits

..

No commits in common. "2282a49563e9a5fe1fc38174229fffcbfe52547d" and "b82fdfb2c8d3ebc891842706dd4bbb017e7fa78a" have entirely different histories.

5 changed files with 45 additions and 42 deletions

View File

@ -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(
@ -194,6 +197,12 @@ class AudioContentController(private val service: AudioContentService) {
@PostMapping("/release")
@PreAuthorize("hasRole('BOT')")
fun releaseContent() = run {
ApiResponse.ok(service.releaseContent())
val contentIdList = repository.getNotReleaseContentId()
for (contentId in contentIdList) {
service.releaseContent(contentId)
}
ApiResponse.ok(null)
}
}

View File

@ -387,10 +387,7 @@ class AudioContentService(
}
@Transactional
fun releaseContent() {
val contentIdList = repository.getNotReleaseContentId()
for (contentId in contentIdList) {
fun releaseContent(contentId: Long) {
val audioContent = repository.findByIdOrNull(contentId)
?: throw SodaException("잘못된 요청입니다.")
@ -420,7 +417,6 @@ class AudioContentService(
)
)
}
}
fun getDetail(id: Long, member: Member, timezone: String): GetAudioContentDetailResponse {
// 묶음 콘텐츠 조회

View File

@ -5,7 +5,7 @@ data class CreateAudioContentRequest(
val detail: String,
val tags: String,
val price: Int,
val timezone: String = "Asia/Seoul",
val timezone: String,
val releaseDate: String? = null,
val themeId: Long = 0,
val isAdult: Boolean = false,

View File

@ -186,7 +186,6 @@ class FcmSendListener(
FcmEventType.SEND_MESSAGE -> {
val response = memberRepository.getMessageRecipientPushToken(messageId = fcmEvent.messageId!!)
if (response != null) {
pushService.send(
tokens = listOf(response.pushToken),
title = fcmEvent.title,
@ -195,7 +194,6 @@ class FcmSendListener(
messageId = fcmEvent.messageId
)
}
}
FcmEventType.CHANGE_NOTICE -> {
if (fcmEvent.creatorId != null) {

View File

@ -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(