57 lines
1.1 KiB
Go
57 lines
1.1 KiB
Go
package request
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
type GetSkillLevelListRequest struct {
|
|
AccessToken string
|
|
SkillId string
|
|
}
|
|
|
|
// 参数合法性检验
|
|
func (request *GetSkillLevelListRequest) CheckParameter() (err error) {
|
|
|
|
if len(request.AccessToken) == 0 {
|
|
err = errors.New("AccessToken不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.SkillId) == 0 {
|
|
err = errors.New("SkillId不能为空")
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
type GetOrderRankReq struct {
|
|
BasePageRequest
|
|
Category string // day week month
|
|
GuildId string
|
|
GroupByFields []string
|
|
}
|
|
|
|
// 参数合法性检验
|
|
func (request *GetOrderRankReq) CheckParameter() (err error) {
|
|
|
|
if len(request.AccessToken) == 0 {
|
|
err = errors.New("AccessToken不能为空")
|
|
return
|
|
}
|
|
if request.Category != "week" && request.Category != "day" && request.Category != "month" {
|
|
err = errors.New("参数Category错误不支持")
|
|
return
|
|
}
|
|
if len(request.GroupByFields) != 0 {
|
|
for _, _ = range request.GroupByFields {
|
|
// _, ok := order.WhitelistFields[field]
|
|
// if !ok {
|
|
// err = errors.New("包含不支持的字段")
|
|
// return
|
|
// }
|
|
}
|
|
}
|
|
return
|
|
}
|