라이브 취소 푸시 발송 로직 추가
This commit is contained in:
parent
d6dfa63bea
commit
896246d9ed
|
@ -19,6 +19,7 @@ class FcmEvent(
|
||||||
val message: String,
|
val message: String,
|
||||||
val container: String = "",
|
val container: String = "",
|
||||||
val recipients: List<Long> = listOf(),
|
val recipients: List<Long> = listOf(),
|
||||||
|
val recipientsMap: Map<String, List<List<String>>>? = null,
|
||||||
val isAuth: Boolean = false,
|
val isAuth: Boolean = false,
|
||||||
val roomId: Long? = null,
|
val roomId: Long? = null,
|
||||||
val contentId: Long? = null,
|
val contentId: Long? = null,
|
||||||
|
@ -133,12 +134,9 @@ class FcmSendListener(
|
||||||
}
|
}
|
||||||
|
|
||||||
FcmEventType.CANCEL_LIVE -> {
|
FcmEventType.CANCEL_LIVE -> {
|
||||||
if (fcmEvent.roomId != null) {
|
if (fcmEvent.recipientsMap != null) {
|
||||||
val pushTokenList = memberRepository.getPushTokenFromReservationList(fcmEvent.roomId)
|
val iosPushTokens = fcmEvent.recipientsMap["ios"]
|
||||||
|
val aosPushToken = fcmEvent.recipientsMap["aos"]
|
||||||
val iosPushTokens = pushTokenList["ios"]
|
|
||||||
val aosPushToken = pushTokenList["aos"]
|
|
||||||
|
|
||||||
if (iosPushTokens != null) {
|
if (iosPushTokens != null) {
|
||||||
for (tokens in iosPushTokens) {
|
for (tokens in iosPushTokens) {
|
||||||
pushService.send(
|
pushService.send(
|
||||||
|
|
|
@ -474,6 +474,7 @@ class LiveRoomService(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val pushTokenListMap = memberRepository.getPushTokenFromReservationList(request.roomId)
|
||||||
reservationRepository.cancelReservation(roomId = room.id!!)
|
reservationRepository.cancelReservation(roomId = room.id!!)
|
||||||
|
|
||||||
applicationEventPublisher.publishEvent(
|
applicationEventPublisher.publishEvent(
|
||||||
|
@ -481,7 +482,7 @@ class LiveRoomService(
|
||||||
type = FcmEventType.CANCEL_LIVE,
|
type = FcmEventType.CANCEL_LIVE,
|
||||||
title = room.member!!.nickname,
|
title = room.member!!.nickname,
|
||||||
message = "라이브 취소 : ${room.title}",
|
message = "라이브 취소 : ${room.title}",
|
||||||
roomId = request.roomId
|
recipientsMap = pushTokenListMap
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue