d9c8de27e5
* refactor: executors and routers
31 lines
682 B
Go
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"`
|
|
}
|