package task import ( "ArmedPolice/utils" "encoding/json" ) type Order struct { ID string `json:"id"` Name string `json:"name"` } func (this *Order) MarshalBinary() ([]byte, error) { return json.Marshal(this) } func (this *Order) UnmarshalBinary(data []byte) error { return utils.FromJSONBytes(data, this) } func (this *Order) Handle() error { return nil } func NewOrder() *Order { return &Order{ID: "23", Name: "Henry"} }