feat: use rabbit to projection bus
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.entity.GameId
|
||||
import eventDemo.libs.event.projection.Projection
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
sealed interface GameProjection : Projection<GameId>
|
||||
@@ -1,7 +1,5 @@
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.entity.GameId
|
||||
import eventDemo.libs.bus.Bus
|
||||
import eventDemo.libs.event.projection.Projection
|
||||
|
||||
interface GameProjectionBus : Bus<Projection<GameId>>
|
||||
interface GameProjectionBus : Bus<GameProjection>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package eventDemo.business.event.projection.gameList
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.entity.GameId
|
||||
import eventDemo.business.entity.Player
|
||||
@@ -15,7 +15,7 @@ data class GameList(
|
||||
val status: Status = Status.OPENING,
|
||||
val players: Set<Player> = emptySet(),
|
||||
val winners: Set<Player> = emptySet(),
|
||||
) : Projection<GameId> {
|
||||
) : GameProjection {
|
||||
enum class Status {
|
||||
OPENING,
|
||||
IS_STARTED,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package eventDemo.business.event.projection.gameList
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.event.event.CardIsPlayedEvent
|
||||
import eventDemo.business.event.event.GameEvent
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package eventDemo.business.event.projection.gameList
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
interface GameListRepository {
|
||||
fun getList(): List<GameList>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package eventDemo.business.event.projection.gameState
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.entity.Card
|
||||
import eventDemo.business.entity.Deck
|
||||
@@ -25,7 +25,7 @@ data class GameState(
|
||||
val isStarted: Boolean = false,
|
||||
val playerWins: Set<Player> = emptySet(),
|
||||
val lastEvent: GameEvent? = null,
|
||||
) : Projection<GameId> {
|
||||
) : GameProjection {
|
||||
enum class Direction {
|
||||
CLOCKWISE,
|
||||
COUNTER_CLOCKWISE,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package eventDemo.business.event.projection.gameState
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.entity.Card
|
||||
import eventDemo.business.event.event.CardIsPlayedEvent
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eventDemo.business.event.projection.gameState
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.entity.GameId
|
||||
import eventDemo.business.event.event.GameEvent
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import eventDemo.business.event.event.PlayerHavePassEvent
|
||||
import eventDemo.business.event.event.PlayerReadyEvent
|
||||
import eventDemo.business.event.event.PlayerWinEvent
|
||||
import eventDemo.business.event.projection.GameProjectionBus
|
||||
import eventDemo.business.event.projection.gameState.GameState
|
||||
import eventDemo.business.event.projection.GameState
|
||||
import eventDemo.business.notification.ItsTheTurnOfNotification
|
||||
import eventDemo.business.notification.Notification
|
||||
import eventDemo.business.notification.PlayerAsJoinTheGameNotification
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import eventDemo.business.event.GameEventHandler
|
||||
import eventDemo.business.event.event.GameStartedEvent
|
||||
import eventDemo.business.event.event.PlayerWinEvent
|
||||
import eventDemo.business.event.projection.GameProjectionBus
|
||||
import eventDemo.business.event.projection.gameState.GameState
|
||||
import eventDemo.business.event.projection.GameState
|
||||
import eventDemo.libs.event.projection.Projection
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||
|
||||
Reference in New Issue
Block a user