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

52 lines
889 B
Go

package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
)
// 代理商上分接口
type AgentTransferRequest struct {
AgentId string
Uid string
OrderId string
Diamond string
Signature string
}
// 参数合法性检验
func (request *AgentTransferRequest) CheckParameter() (err error) {
if len(request.AgentId) == 0 {
err = errors.New("AgentId不能为空")
return
}
if len(request.Uid) == 0 {
err = errors.New("Uid不能为空")
return
}
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
if len(request.Diamond) == 0 {
err = errors.New("Diamond不能为空")
return
}
if HyTools.StringToInt(request.Diamond) <= 0 {
err = errors.New("Diamond不能为负数")
return
}
if len(request.Signature) == 0 {
err = errors.New("Signature不能为空")
return
}
return
}