Compare commits
No commits in common. "56f7b6c4492482a6331e3adc7d082deb99e42449" and "76b2b5f7e33245bed0756f8d7887e1a5a182a5d7" have entirely different histories.
56f7b6c449
...
76b2b5f7e3
|
@ -65,7 +65,7 @@ class FcmSendListener(
|
||||||
tokens = tokens,
|
tokens = tokens,
|
||||||
title = fcmEvent.title,
|
title = fcmEvent.title,
|
||||||
message = fcmEvent.message,
|
message = fcmEvent.message,
|
||||||
container = "ios"
|
container = fcmEvent.container
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,34 +76,14 @@ class FcmSendListener(
|
||||||
tokens = tokens,
|
tokens = tokens,
|
||||||
title = fcmEvent.title,
|
title = fcmEvent.title,
|
||||||
message = fcmEvent.message,
|
message = fcmEvent.message,
|
||||||
container = "aos"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FcmEventType.CREATE_LIVE -> {
|
|
||||||
if (fcmEvent.container.isNotBlank()) {
|
|
||||||
val pushTokens = memberRepository.getCreateLiveRoomNotificationRecipientPushTokens(
|
|
||||||
creatorId = fcmEvent.creatorId!!,
|
|
||||||
isAuth = fcmEvent.isAuth,
|
|
||||||
container = fcmEvent.container
|
container = fcmEvent.container
|
||||||
)
|
)
|
||||||
|
}
|
||||||
for (tokens in pushTokens) {
|
|
||||||
pushService.send(
|
|
||||||
tokens = tokens,
|
|
||||||
title = fcmEvent.title,
|
|
||||||
message = fcmEvent.message,
|
|
||||||
container = fcmEvent.container,
|
|
||||||
roomId = fcmEvent.roomId
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FcmEventType.START_LIVE -> {
|
FcmEventType.CREATE_LIVE, FcmEventType.START_LIVE -> {
|
||||||
if (fcmEvent.container.isNotBlank()) {
|
if (fcmEvent.container.isNotBlank()) {
|
||||||
val pushTokens = memberRepository.getCreateLiveRoomNotificationRecipientPushTokens(
|
val pushTokens = memberRepository.getCreateLiveRoomNotificationRecipientPushTokens(
|
||||||
creatorId = fcmEvent.creatorId!!,
|
creatorId = fcmEvent.creatorId!!,
|
||||||
|
|
|
@ -3,14 +3,11 @@ package kr.co.vividnext.sodalive.fcm
|
||||||
import com.google.firebase.messaging.FirebaseMessaging
|
import com.google.firebase.messaging.FirebaseMessaging
|
||||||
import com.google.firebase.messaging.MulticastMessage
|
import com.google.firebase.messaging.MulticastMessage
|
||||||
import com.google.firebase.messaging.Notification
|
import com.google.firebase.messaging.Notification
|
||||||
import org.slf4j.LoggerFactory
|
|
||||||
import org.springframework.scheduling.annotation.Async
|
import org.springframework.scheduling.annotation.Async
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class FcmService {
|
class FcmService {
|
||||||
private val logger = LoggerFactory.getLogger(this::class.java)
|
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
fun send(
|
fun send(
|
||||||
tokens: List<String>,
|
tokens: List<String>,
|
||||||
|
@ -21,8 +18,6 @@ class FcmService {
|
||||||
messageId: Long? = null,
|
messageId: Long? = null,
|
||||||
contentId: Long? = null
|
contentId: Long? = null
|
||||||
) {
|
) {
|
||||||
if (tokens.isNotEmpty()) {
|
|
||||||
logger.info("os: $container")
|
|
||||||
val multicastMessage = MulticastMessage.builder()
|
val multicastMessage = MulticastMessage.builder()
|
||||||
.addAllTokens(tokens)
|
.addAllTokens(tokens)
|
||||||
|
|
||||||
|
@ -52,9 +47,6 @@ class FcmService {
|
||||||
multicastMessage.putData("content_id", contentId.toString())
|
multicastMessage.putData("content_id", contentId.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
val response = FirebaseMessaging.getInstance().sendEachForMulticast(multicastMessage.build())
|
FirebaseMessaging.getInstance().sendEachForMulticast(multicastMessage.build())
|
||||||
logger.info("보내기 성공: ${response.successCount}")
|
|
||||||
logger.info("보내기 실패: ${response.failureCount}")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,6 @@ class LiveRoomService(
|
||||||
channelName = room.channelName,
|
channelName = room.channelName,
|
||||||
beginDateTime = beginDateTime.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")),
|
beginDateTime = beginDateTime.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")),
|
||||||
isPaid = false,
|
isPaid = false,
|
||||||
isAdult = room.isAdult,
|
|
||||||
isPrivateRoom = room.type == LiveRoomType.PRIVATE,
|
isPrivateRoom = room.type == LiveRoomType.PRIVATE,
|
||||||
password = room.password
|
password = room.password
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,7 +9,6 @@ data class GetRoomDetailResponse(
|
||||||
val title: String,
|
val title: String,
|
||||||
val notice: String,
|
val notice: String,
|
||||||
var isPaid: Boolean,
|
var isPaid: Boolean,
|
||||||
val isAdult: Boolean,
|
|
||||||
val isPrivateRoom: Boolean,
|
val isPrivateRoom: Boolean,
|
||||||
val password: String?,
|
val password: String?,
|
||||||
val tags: List<String>,
|
val tags: List<String>,
|
||||||
|
|
|
@ -80,7 +80,6 @@ class MemberQueryRepositoryImpl(
|
||||||
var where = member.isActive.isTrue
|
var where = member.isActive.isTrue
|
||||||
.and(member.email.notIn("admin@sodalive.net"))
|
.and(member.email.notIn("admin@sodalive.net"))
|
||||||
.and(member.container.eq(container))
|
.and(member.container.eq(container))
|
||||||
.and(member.pushToken.isNotNull)
|
|
||||||
|
|
||||||
if (isAuth) {
|
if (isAuth) {
|
||||||
where = where.and(member.auth.isNotNull)
|
where = where.and(member.auth.isNotNull)
|
||||||
|
@ -114,7 +113,6 @@ class MemberQueryRepositoryImpl(
|
||||||
blockMemberRepository.getBlockedMemberList(creatorId)
|
blockMemberRepository.getBlockedMemberList(creatorId)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.and(creatorFollowing.member.pushToken.isNotNull)
|
|
||||||
|
|
||||||
if (isAuth) {
|
if (isAuth) {
|
||||||
where = where.and(member.auth.isNotNull)
|
where = where.and(member.auth.isNotNull)
|
||||||
|
@ -151,7 +149,6 @@ class MemberQueryRepositoryImpl(
|
||||||
blockMemberRepository.getBlockedMemberList(creatorId)
|
blockMemberRepository.getBlockedMemberList(creatorId)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.and(creatorFollowing.member.pushToken.isNotNull)
|
|
||||||
|
|
||||||
if (isAuth) {
|
if (isAuth) {
|
||||||
where = where.and(member.auth.isNotNull)
|
where = where.and(member.auth.isNotNull)
|
||||||
|
@ -180,10 +177,7 @@ class MemberQueryRepositoryImpl(
|
||||||
)
|
)
|
||||||
.from(message)
|
.from(message)
|
||||||
.innerJoin(message.recipient, member)
|
.innerJoin(message.recipient, member)
|
||||||
.where(
|
.where(message.id.eq(messageId))
|
||||||
message.id.eq(messageId)
|
|
||||||
.and(member.pushToken.isNotNull)
|
|
||||||
)
|
|
||||||
.fetchFirst()
|
.fetchFirst()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +188,6 @@ class MemberQueryRepositoryImpl(
|
||||||
var where = member.isActive.isTrue
|
var where = member.isActive.isTrue
|
||||||
.and(member.email.notIn("admin@sodalive.net"))
|
.and(member.email.notIn("admin@sodalive.net"))
|
||||||
.and(member.id.`in`(*recipients.toTypedArray()))
|
.and(member.id.`in`(*recipients.toTypedArray()))
|
||||||
.and(member.pushToken.isNotNull)
|
|
||||||
|
|
||||||
if (isAuth) {
|
if (isAuth) {
|
||||||
where = where.and(member.auth.isNotNull)
|
where = where.and(member.auth.isNotNull)
|
||||||
|
|
Loading…
Reference in New Issue