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

30 lines
529 B
Go

package inner
import "errors"
type OpenBoxRequest struct {
AccessToken string
OpenCount string
}
// 参数合法性检验
func (request *OpenBoxRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.OpenCount) == 0 {
err = errors.New("OpenCount不能为空")
return
}
if request.OpenCount != "1" && request.OpenCount != "10" && request.OpenCount != "100" {
err = errors.New("OpenCount非法")
return
}
return
}