feat(app): update
This commit is contained in:
58
pkg/dto/request/GetSkillLevelListRequest.go
Normal file
58
pkg/dto/request/GetSkillLevelListRequest.go
Normal file
@ -0,0 +1,58 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"gitea.ddegame.cn/open/servicebase/pkg/common/order"
|
||||
)
|
||||
|
||||
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 _, field := range request.GroupByFields {
|
||||
_, ok := order.WhitelistFields[field]
|
||||
if !ok {
|
||||
err = errors.New("包含不支持的字段")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user