refactor: remove persister abstraction layer
Inline persistence logic directly into game stores and handlers: - game/persist.go: DB mapping methods on GameStore and GameInstance - snake/persist.go: DB mapping methods on SnakeStore and SnakeGameInstance - Chat persistence inlined into c4game handlers - Delete db/persister.go (GamePersister, SnakePersister, ChatPersister) - Stores now take *repository.Queries directly instead of Persister interface
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/ryanhamamura/c4/config"
|
||||
"github.com/ryanhamamura/c4/db"
|
||||
"github.com/ryanhamamura/c4/db/repository"
|
||||
"github.com/ryanhamamura/c4/features/auth"
|
||||
"github.com/ryanhamamura/c4/features/c4game"
|
||||
@@ -30,7 +29,6 @@ func SetupRoutes(
|
||||
nc *nats.Conn,
|
||||
store *game.GameStore,
|
||||
snakeStore *snake.SnakeStore,
|
||||
chatPersister *db.ChatPersister,
|
||||
assets embed.FS,
|
||||
) error {
|
||||
// Static assets
|
||||
@@ -44,7 +42,7 @@ func SetupRoutes(
|
||||
|
||||
auth.SetupRoutes(router, queries, sessions)
|
||||
lobby.SetupRoutes(router, queries, sessions, store, snakeStore)
|
||||
c4game.SetupRoutes(router, store, nc, sessions, chatPersister)
|
||||
c4game.SetupRoutes(router, store, nc, sessions, queries)
|
||||
snakegame.SetupRoutes(router, snakeStore, nc, sessions)
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user