fs storage

This commit is contained in:
Ilia Denisov
2026-03-13 21:07:23 +02:00
committed by GitHub
parent 43039a79bf
commit 9ade76e21d
117 changed files with 1734 additions and 176 deletions
+28
View File
@@ -0,0 +1,28 @@
package handler
import (
"net/http"
"galaxy/model/rest"
"github.com/gin-gonic/gin"
)
func InitHandler(c *gin.Context, executor CommandExecutor) {
var init rest.Init
if errorResponse(c, c.ShouldBindJSON(&init)) {
return
}
races := make([]string, len(init.Races))
for i := range init.Races {
races[i] = init.Races[i].Name
}
s, err := executor.GenerateGame(races)
if errorResponse(c, err) {
return
}
c.JSON(http.StatusCreated, s)
}