Skip to content

Commit

Permalink
Merge branch 'feature/DRAW-330' into sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
comforest committed Sep 16, 2024
2 parents da9ee74 + 50715ce commit e56bdeb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.xorker.draw.firebase
import com.google.firebase.messaging.FirebaseMessaging
import com.google.firebase.messaging.Message
import com.google.firebase.messaging.Notification
import com.xorker.draw.notification.PushMessageService
import com.xorker.draw.notification.PushMessageUseCase
import com.xorker.draw.websocket.WaitingQueueSession
import java.util.Locale
import org.springframework.context.MessageSource
Expand All @@ -12,7 +12,7 @@ import org.springframework.stereotype.Service
@Service
class FcmService(
private val messageSource: MessageSource,
) : PushMessageService {
) : PushMessageUseCase {

override fun quickStart(session: WaitingQueueSession) {
quickStart(session.locale, session.user.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.xorker.draw.mafia

import com.xorker.draw.exception.UnSupportedException
import com.xorker.draw.mafia.event.MafiaGameRandomMatchingEvent
import com.xorker.draw.notification.PushMessageService
import com.xorker.draw.notification.PushMessageUseCase
import com.xorker.draw.websocket.WaitingQueueSession
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ConcurrentLinkedQueue
Expand All @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component
@Component
internal class MafiaGameWaitingQueueAdapter(
private val eventPublisher: ApplicationEventPublisher,
private val pushMessageService: PushMessageService,
private val pushMessageUseCase: PushMessageUseCase,
) : MafiaGameWaitingQueueRepository {
private val waitingQueue: ConcurrentHashMap<String, ConcurrentLinkedQueue<WaitingQueueSession>> = ConcurrentHashMap()

Expand All @@ -35,7 +35,7 @@ internal class MafiaGameWaitingQueueAdapter(

eventPublisher.publishEvent(event)
} else {
pushMessageService.quickStart(session)
pushMessageUseCase.quickStart(session)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.xorker.draw.notification

import com.xorker.draw.websocket.WaitingQueueSession

interface PushMessageUseCase {
fun quickStart(session: WaitingQueueSession)
}

0 comments on commit e56bdeb

Please sign in to comment.