Create route to list all the games

This commit is contained in:
2025-03-17 22:36:08 +01:00
parent 8074881d57
commit c3155da23c
14 changed files with 304 additions and 18 deletions

View File

@@ -2,9 +2,11 @@ package eventDemo.configuration.injection
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInMemory
import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInMemory
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInMemory
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInMemory
import eventDemo.business.event.GameEventBus
import eventDemo.business.event.GameEventStore
import eventDemo.business.event.projection.gameList.GameListRepository
import eventDemo.business.event.projection.gameState.GameStateRepository
import eventDemo.libs.event.projection.SnapshotConfig
import org.koin.core.module.Module
@@ -22,4 +24,8 @@ fun Module.configureDIInfrastructure() {
single {
GameStateRepositoryInMemory(get(), get(), snapshotConfig = SnapshotConfig())
} bind GameStateRepository::class
single {
GameListRepositoryInMemory(get(), get(), snapshotConfig = SnapshotConfig())
} bind GameListRepository::class
}

View File

@@ -1,5 +1,6 @@
package eventDemo.configuration.route
import eventDemo.adapter.interfaceLayer.readGamesList
import eventDemo.adapter.interfaceLayer.readTheGameState
import io.ktor.server.application.Application
import io.ktor.server.routing.routing
@@ -8,5 +9,6 @@ import org.koin.ktor.ext.get
fun Application.declareHttpGameRoute() {
routing {
readTheGameState(get())
readGamesList(get())
}
}