update_customer_value.go
622 字节
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type UpdateCustomerValueCommand struct {
// 客户价值ID
CustomerValueId int `json:"customerValueId,omitempty"`
// 客户价值名称
CustomerValueName string `json:"customerValueName,omitempty"`
}
func (updateCustomerValueCommand *UpdateCustomerValueCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(updateCustomerValueCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}