feat: command api

This commit is contained in:
IliaDenisov
2026-02-11 15:40:58 +03:00
parent 5697d0ad57
commit 751214e5d0
2 changed files with 233 additions and 5 deletions
+6 -5
View File
@@ -12,15 +12,15 @@ type CommandType string
const (
CommandTypeRaceQuit CommandType = "raceQuit"
CommandTypeRaceVote CommandType = "raceVote"
CommandTypeRaceRelation CommandType = "declarePeace"
CommandTypeRaceRelation CommandType = "raceRelation"
CommandTypeShipClassCreate CommandType = "shipClassCreate"
CommandTypeShipClassMerge CommandType = "shipClassMerge"
CommandTypeShipClassRemove CommandType = "shipClassRemove"
CommandTypeShipGroupBreak CommandType = "shipGroupBreak"
CommandTypeShipGroupLoad CommandType = "shipGroupLoad"
CommandTypeShipGroupUnload CommandType = "shipGroupUnload"
CommandTypeShipGroupSend CommandType = "shipGroupSend"
CommandTypeShipGroupUpgrade CommandType = "shipGroupUpgrade"
CommandTypeShipGroupBreak CommandType = "shipGroupBreak"
CommandTypeShipGroupMerge CommandType = "shipGroupMerge"
CommandTypeShipGroupDismantle CommandType = "shipGroupDismantle"
CommandTypeShipGroupTransfer CommandType = "shipGroupTransfer"
@@ -104,9 +104,9 @@ type CommandShipGroupSend struct {
type CommandShipGroupUpgrade struct {
CommandMeta
ID string `json:"id" binding:"required,uuid_rfc4122"`
Tech string `json:"tech" binding:"oneof=ALL DRIVE WEAPONS SHIELDS CARGO"`
Level int `json:"level" binding:"gte=1"`
ID string `json:"id" binding:"required,uuid_rfc4122"`
Tech string `json:"tech" binding:"oneof=ALL DRIVE WEAPONS SHIELDS CARGO"`
Level float64 `json:"level" binding:"gte=1"`
}
type CommandShipGroupMerge struct {
@@ -116,6 +116,7 @@ type CommandShipGroupMerge struct {
type CommandShipGroupBreak struct {
CommandMeta
ID string `json:"id" binding:"required,uuid_rfc4122"`
NewID string `json:"newId" binding:"required,uuid_rfc4122"`
Quantity int `json:"quantity" binding:"gte=0"`
}