feat(app): update
This commit is contained in:
39
pkg/dto/inner/AttackBossRequest.go
Normal file
39
pkg/dto/inner/AttackBossRequest.go
Normal file
@ -0,0 +1,39 @@
|
||||
package inner
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
|
||||
)
|
||||
|
||||
type AttackBossRequest struct {
|
||||
AccessToken string
|
||||
RoomId string
|
||||
BossId string
|
||||
AttackCount string
|
||||
}
|
||||
|
||||
// 参数合法性检验
|
||||
func (request *AttackBossRequest) CheckParameter() (err error) {
|
||||
|
||||
if len(request.AccessToken) == 0 {
|
||||
err = errors.New("UserId不能为空")
|
||||
return
|
||||
}
|
||||
if len(request.BossId) == 0 {
|
||||
err = errors.New("BossId不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if len(request.AttackCount) == 0 {
|
||||
err = errors.New("AttackCount不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if HyTools.StringToInt(request.AttackCount) < 1 || HyTools.StringToInt(request.AttackCount) > 100000 {
|
||||
err = errors.New("AttackCount不合法")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user