feat: turn generate api

This commit is contained in:
IliaDenisov
2026-02-12 14:27:56 +03:00
parent 67f0fdef61
commit 87291d2760
16 changed files with 192 additions and 51 deletions
+6 -4
View File
@@ -4,7 +4,6 @@ import (
"encoding/json"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/iliadenisov/galaxy/internal/model/rest"
"github.com/iliadenisov/galaxy/internal/router"
"github.com/iliadenisov/galaxy/internal/router/handler"
@@ -19,8 +18,12 @@ func (e *dummyExecutor) Execute(command ...handler.Command) error {
return nil
}
func (e *dummyExecutor) GenerateGame(races []string) (uuid.UUID, error) {
return uuid.New(), nil
func (e *dummyExecutor) GenerateGame(races []string) (rest.StateResponse, error) {
return rest.StateResponse{}, nil
}
func (e *dummyExecutor) GenerateTurn() (rest.StateResponse, error) {
return rest.StateResponse{}, nil
}
func (e *dummyExecutor) GameState() (rest.StateResponse, error) {
@@ -32,7 +35,6 @@ func setupRouter() *gin.Engine {
}
func setupRouterExecutor(e handler.CommandExecutor) *gin.Engine {
gin.SetMode(gin.TestMode)
return router.SetupRouter(e)
}