search_exchange_cash_activity.go 585 字节
package command

import (
	"fmt"
	"github.com/astaxie/beego/validation"
)

type SearchExchangeCashActivityCommand struct {
	ExchangeCashActivityName string `json:"exchangeCashActivityName"`  // 兑换现金活动名称
}

func (searchExchangeCashActivityCommand *SearchExchangeCashActivityCommand) ValidateCommand() error {
	valid := validation.Validation{}
	b, err := valid.Valid(searchExchangeCashActivityCommand)
	if err != nil {
		return err
	}
	if !b {
		for _, validErr := range valid.Errors {
			return fmt.Errorf("%s  %s", validErr.Key, validErr.Message)
		}
	}
	return nil
}