remove_exchange_cash_activity.go
572 字节
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
// 删除兑换现金活动
type RemoveExchangeCashActivityCommand struct {
ActivityId int64 `json:"activityId" valid:"Required"`
}
func (removeExchangeCashActivityCommand *RemoveExchangeCashActivityCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(removeExchangeCashActivityCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}