search_su_money_transaction.go 540 字节
package command

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

type SearchSuMoneyTransactionCommand struct {
	EmployeeName string `json:"employeeName"`  // 员工姓名
}

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