Files
galaxy-game/internal/model/rest/command.go
T
Ilia Denisov d9c8de27e5 refactor: executors and routers
* refactor: executors and routers
2026-02-09 15:53:34 +03:00

31 lines
682 B
Go

package rest
import "encoding/json"
type Command struct {
Actor string `json:"actor" binding:"required,notblank"`
Commands []json.RawMessage `json:"cmd" binding:"min=1"`
}
type CommandType string
const (
CommandTypeVote CommandType = "vote"
CommandTypeRelation CommandType = "declarePeace"
)
type CommandMeta struct {
Type CommandType `json:"@type"`
}
type CommandVote struct {
CommandMeta
Recipient string `json:"recipient" binding:"required,notblank"`
}
type CommandUpdateRelation struct {
CommandMeta
Opponent string `json:"recipient" binding:"required,notblank"`
Relation string `json:"relation" binding:"required,notblank"`
}