rule_delete.go
390 字节
package command
import "github.com/beego/beego/v2/core/validation"
type DeleteRuleCommand struct {
CompanyId int64 `cname:"公司ID" json:"companyId"`
Id int64 `cname:"规则ID" json:"id,string" valid:"Required"`
}
func (in *DeleteRuleCommand) Valid(validation *validation.Validation) {
if in.CompanyId == 0 {
validation.SetError("companyId", "公司ID无效")
return
}
}