feat(app): update

This commit is contained in:
Yangtao
2025-11-19 14:24:13 +08:00
parent 1eac66d7fd
commit 0c34585649
329 changed files with 10760 additions and 281 deletions

View File

@ -0,0 +1,68 @@
package inner
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
"gitea.ddegame.cn/open/servicebase/pkg/constant"
)
type MwebRechargeRequest struct {
Mobile string
ProductId string
PayType string // 支付方式
RechargeChannel string // 充值平台 1 = APP-iOS 2= APP-Android 3= 微信公众号 4= 支付宝服务窗
ClientRealIp string // 客户端真实IP
OpenId string // 公众号支付时需要
DeviceOs string // 设备类型
CashAmount string // 自定义金额
}
// 参数合法性检验
func (request *MwebRechargeRequest) CheckParameter() (err error) {
if len(request.Mobile) == 0 {
err = errors.New("Mobile不能为空")
return
}
if len(request.ProductId) == 0 {
err = errors.New("ProductId不能为空")
return
}
if len(request.PayType) == 0 {
err = errors.New("PayType不能为空")
return
}
if len(request.RechargeChannel) == 0 {
err = errors.New("RechargeChannel不能为空")
return
}
//if request.RechargeChannel == "3" {
// if len(request.OpenId) == 0{
// err = errors.New("OpenID不能为空")
// return
// }
//}
// 自定义充值
if request.ProductId == constant.CustomerProductId {
if len(request.CashAmount) == 0 {
err = errors.New("自定义充值金额不能为空")
return
}
cash := HyTools.StringToInt(request.CashAmount)
if cash < 1 || cash > 80000 {
err = errors.New("自定义充值金额只能1到80000元")
return
}
}
return
}