exchange_list_ranking.go 691 字节
package query

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

type ExchangeListRankingQuery struct {
	ActivityId int64 `json:"activityId"`
	CompanyId int64 `json:"companyId"`  // 公司ID
	Offset int `json:"offset,omitempty"`  // 查询偏离量
	Limit int `json:"limit,omitempty"`   // 查询限制
	Uid int64 `json:"uid"` // 统一用户id
}

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