enable_cooperation_contract.go
778 字节
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type EnableCooperationContractCommand struct {
// 共创合约ID
CooperationContractId []string `json:"cooperationContractId" valid:"Required"`
// 暂停和恢复的状态
Status int `json:"status,omitempty"`
}
func (enableCooperationContractCommand *EnableCooperationContractCommand) Valid(validation *validation.Validation) {
}
func (enableCooperationContractCommand *EnableCooperationContractCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(enableCooperationContractCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}