Files
servicebase/pkg/dto/inner/AttackBossRequest.go
2025-11-19 14:24:13 +08:00

40 lines
739 B
Go

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
}