remove_customer_value.go
543 字节
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type RemoveCustomerValueCommand struct {
// 客户价值ID
CustomerValueId int `json:"customerValueId" valid:"Required"`
}
func (removeCustomerValueCommand *RemoveCustomerValueCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(removeCustomerValueCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}