# Conflicts: # docs/docs.go # docs/swagger.json # docs/swagger.yamlmaster
@@ -12,6 +12,7 @@ import ( | |||
"code.fnuoos.com/EggPlanet/egg_system_rules.git/enum" | |||
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/md" | |||
"code.fnuoos.com/EggPlanet/egg_system_rules.git/rule" | |||
"errors" | |||
"fmt" | |||
"github.com/gin-gonic/gin" | |||
"time" | |||
@@ -290,3 +291,168 @@ func WithdrawApply(c *gin.Context) { | |||
} | |||
e.OutSuc(c, "success", nil) | |||
} | |||
// GetWithdrawCondition | |||
// @Summary 蛋蛋星球-钱包-提现条件(获取) | |||
// @Tags 钱包 | |||
// @Description 提现条件(获取) | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Success 200 {object} md.GetWithdrawConditionResp "具体数据" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/v1/wallet/withdraw/condition [GET] | |||
func GetWithdrawCondition(c *gin.Context) { | |||
user := svc.GetUser(c) | |||
alipayUserInfoDb := implement.NewAlipayUserInfoDb(db.Db) | |||
alipayInfo, err := alipayUserInfoDb.GetAlipayUserInfo(user.Id) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
userInfoDb := implement.NewWxUserInfoDb(db.Db) | |||
wxUserInfo, err := userInfoDb.GetWxUserInfo(user.Id) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
resp := md.GetWithdrawConditionResp{ | |||
IsRealName: func(isRealName int) bool { | |||
switch isRealName { | |||
case 0: | |||
return false | |||
case 1: | |||
return true | |||
default: | |||
return false | |||
} | |||
}(user.IsRealName), | |||
IsBindAlipay: func(alipayInfo *model.AlipayUserInfo) bool { | |||
if alipayInfo == nil { | |||
return false | |||
} else { | |||
return true | |||
} | |||
}(alipayInfo), | |||
IsBindWx: func(wxUserInfo *model.WxUserInfo) bool { | |||
if wxUserInfo == nil { | |||
return false | |||
} else { | |||
return true | |||
} | |||
}(wxUserInfo), | |||
} | |||
e.OutSuc(c, resp, nil) | |||
} | |||
// BindAlipayAccount | |||
// @Summary 蛋蛋星球-钱包-绑定支付宝 | |||
// @Tags 钱包 | |||
// @Description 绑定支付宝 | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Param req body md.BindAlipayAccountReq true "具体参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/v1/wallet/withdraw/bindAlipay [POST] | |||
func BindAlipayAccount(c *gin.Context) { | |||
var req md.BindAlipayAccountReq | |||
err := c.ShouldBindJSON(&req) | |||
if err != nil { | |||
err = svc.HandleValidateErr(err) | |||
err1 := err.(e.E) | |||
e.OutErr(c, err1.Code, err1.Error()) | |||
return | |||
} | |||
user := svc.GetUser(c) | |||
alipayUserInfoDb := implement.NewAlipayUserInfoDb(db.Db) | |||
alipayUserInfo, err := alipayUserInfoDb.GetAlipayUserInfo(user.Id) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
if alipayUserInfo != nil { | |||
e.OutErr(c, e.ERR, errors.New("用户已绑定支付宝").Error()) | |||
return | |||
} | |||
now := time.Now() | |||
newAlipayUserInfo := model.AlipayUserInfo{ | |||
Uid: user.Id, | |||
UserId: req.UserId, | |||
OpenId: req.OpenId, | |||
AppId: req.AppId, | |||
Ext: req.Ext, | |||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||
} | |||
affected, err := alipayUserInfoDb.AlipayUserInfoInsert(&newAlipayUserInfo) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
if affected <= 0 { | |||
e.OutErr(c, e.ERR, errors.New("绑定失败")) | |||
return | |||
} | |||
e.OutSuc(c, "success", nil) | |||
} | |||
// BindWxPayAccount | |||
// @Summary 蛋蛋星球-钱包-绑定微信支付 | |||
// @Tags 钱包 | |||
// @Description 绑定微信支付 | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Param req body md.BindWxPayAccountReq true "具体参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/v1/wallet/withdraw/bindWxPay [POST] | |||
func BindWxPayAccount(c *gin.Context) { | |||
var req md.BindWxPayAccountReq | |||
err := c.ShouldBindJSON(&req) | |||
if err != nil { | |||
err = svc.HandleValidateErr(err) | |||
err1 := err.(e.E) | |||
e.OutErr(c, err1.Code, err1.Error()) | |||
return | |||
} | |||
user := svc.GetUser(c) | |||
wxUserInfoDb := implement.NewWxUserInfoDb(db.Db) | |||
wxUserInfo, err := wxUserInfoDb.GetWxUserInfo(user.Id) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
if wxUserInfo != nil { | |||
e.OutErr(c, e.ERR, errors.New("用户已绑定过微信").Error()) | |||
return | |||
} | |||
now := time.Now() | |||
newWxUserInfo := model.WxUserInfo{ | |||
Uid: user.Id, | |||
UserId: req.UserId, | |||
OpenId: req.OpenId, | |||
AppId: req.AppId, | |||
Ext: req.Ext, | |||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||
} | |||
affected, err := wxUserInfoDb.WxUserInfoInsert(&newWxUserInfo) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
if affected <= 0 { | |||
e.OutErr(c, e.ERR, errors.New("绑定失败")) | |||
} | |||
e.OutSuc(c, "success", nil) | |||
} |
@@ -0,0 +1,73 @@ | |||
package alipay | |||
import ( | |||
"applet/app/db" | |||
"applet/app/utils/cache" | |||
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" | |||
"code.fnuoos.com/EggPlanet/egg_system_rules.git/enum" | |||
"github.com/go-pay/gopay" | |||
"github.com/go-pay/gopay/alipay" | |||
"github.com/go-pay/xlog" | |||
) | |||
type InitAlipayStruct struct { | |||
IsProd bool `json:"is_prod" label:"是否生产环境"` | |||
AlipayAppId string `json:"alipay_app_id" label:"支付宝商家应用appid"` | |||
AlipayPrivateKey string `json:"alipay_private_key" label:"支付宝商家应用私钥"` | |||
AlipayPublicKey string `json:"alipay_public_key" label:"支付宝商家应用公钥"` | |||
AlipayPublicContentRSA2 []byte `json:"alipay_public_content_rsa_2" label:"支付宝公钥证书"` | |||
AlipayRootContent []byte `json:"alipay_root_content" label:"支付宝根证书"` | |||
AppPublicContent []byte `json:"app_public_content" label:"应用公钥证书"` | |||
} | |||
// Init 初始化支付宝客户端 | |||
// appid:应用ID | |||
// privateKey:应用私钥,支持PKCS1和PKCS8 | |||
// isProd:是否是正式环境,沙箱环境请选择新版沙箱应用。 | |||
func InitAlipay(initData *InitAlipayStruct) (client *alipay.Client, err error) { | |||
if initData == nil { | |||
sysCfgDb := implement.NewSysCfgDb(db.Db, cache.GetPool().Get()) | |||
sysCfgMap := sysCfgDb.SysCfgFindWithDb(enum.AlipayAppId, enum.AlipayPrivateKey, enum.AlipayPublicKey, enum.AlipayPublicContentRSA2, enum.AlipayRootContent, enum.AppPublicContent) | |||
initData = &InitAlipayStruct{ | |||
IsProd: true, | |||
AlipayAppId: sysCfgMap[enum.AlipayAppId], | |||
AlipayPrivateKey: sysCfgMap[enum.AlipayPrivateKey], | |||
AlipayPublicKey: sysCfgMap[enum.AlipayPublicKey], | |||
AlipayPublicContentRSA2: []byte(sysCfgMap[enum.AlipayPublicContentRSA2]), | |||
AlipayRootContent: []byte(sysCfgMap[enum.AlipayRootContent]), | |||
AppPublicContent: []byte(sysCfgMap[enum.AppPublicContent]), | |||
} | |||
} | |||
client, err = alipay.NewClient(initData.AlipayAppId, initData.AlipayPrivateKey, initData.IsProd) | |||
if err != nil { | |||
xlog.Error(err) | |||
return | |||
} | |||
// 自定义配置http请求接收返回结果body大小,默认 10MB | |||
client.SetBodySize(10) // 没有特殊需求,可忽略此配置 | |||
// 打开Debug开关,输出日志,默认关闭 | |||
client.DebugSwitch = gopay.DebugOn | |||
client.SetLocation(alipay.LocationShanghai). // 设置时区,不设置或出错均为默认服务器时间 | |||
SetCharset(alipay.UTF8). // 设置字符编码,不设置默认 utf-8 | |||
SetSignType(alipay.RSA2) // 设置签名类型,不设置默认 RSA2 | |||
// SetAppAuthToken("") //授权token | |||
//SetReturnUrl("https://www.fmm.ink"). // 设置返回URL | |||
// SetNotifyUrl("https://www.fmm.ink"). // 设置异步通知URL | |||
// 传入 支付宝公钥证书 alipayPublicCert.crt 内容 | |||
client.AutoVerifySign(initData.AlipayPublicContentRSA2) | |||
// 传入证书内容 | |||
err = client.SetCertSnByContent(initData.AppPublicContent, initData.AlipayRootContent, initData.AlipayPublicContentRSA2) | |||
if err != nil { | |||
xlog.Debug("SetCertSn:", err) | |||
return | |||
} | |||
return | |||
} |
@@ -30,3 +30,23 @@ type WithdrawApplyReq struct { | |||
Amount string `json:"amount"` // 金额 | |||
Kind int `json:"kind"` // 提现方式(1:支付宝 2:微信) | |||
} | |||
type GetWithdrawConditionResp struct { | |||
IsRealName bool `json:"is_real_name"` // 是否实名 | |||
IsBindAlipay bool `json:"is_bind_alipay"` // 是否绑定阿里账户 | |||
IsBindWx bool `json:"is_bind_wx"` // 是否绑定微信账户 | |||
} | |||
type BindAlipayAccountReq struct { | |||
UserId string `json:"user_id"` // 支付宝用户id | |||
OpenId string `json:"open_id"` // 支付宝用户open_id | |||
AppId string `json:"app_id"` // 支付宝商户应用appid | |||
Ext string `json:"ext"` // 拓展字段 | |||
} | |||
type BindWxPayAccountReq struct { | |||
UserId string `json:"user_id"` // 微信用户 id | |||
OpenId string `json:"open_id"` // 微信用户 open_id | |||
AppId string `json:"app_id"` // 微信应用 appid | |||
Ext string `json:"ext" ` // 拓展字段 | |||
} |
@@ -132,10 +132,13 @@ func route(r *gin.RouterGroup) { | |||
rWallet := r.Group("/wallet") // 钱包 | |||
{ | |||
rWallet.GET("/amountFlow", hdl.GetAmountFlow) // 余额流水 | |||
rWithdraw := r.Group("/withdraw") | |||
rWithdraw := rWallet.Group("/withdraw") | |||
{ | |||
rWithdraw.GET("/index", hdl.WithdrawGetAmount) | |||
rWithdraw.POST("/apply", hdl.WithdrawApply) | |||
rWithdraw.GET("/condition", hdl.GetWithdrawCondition) | |||
rWithdraw.POST("/bindAlipay", hdl.BindAlipayAccount) | |||
rWithdraw.POST("/bindWxPay", hdl.BindWxPayAccount) | |||
} | |||
} | |||
@@ -11,6 +11,7 @@ import ( | |||
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" | |||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||
rule2 "code.fnuoos.com/EggPlanet/egg_system_rules.git" | |||
enum2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum" | |||
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/md" | |||
"code.fnuoos.com/EggPlanet/egg_system_rules.git/rule" | |||
"code.fnuoos.com/EggPlanet/egg_system_rules.git/svc" | |||
@@ -150,8 +151,8 @@ func DelGrabRedPackage(req *md.GrabRedPackageReq, user *model.User) (resp []byte | |||
//3、加上给用户加上余额 | |||
dealUserWalletReq := md2.DealUserWalletReq{ | |||
Direction: "add", | |||
Kind: 5, | |||
Title: "领取红包收益", | |||
Kind: int(enum2.UserReceiveRedPackage), | |||
Title: enum2.UserReceiveRedPackage.String(), | |||
Uid: user.Id, | |||
Amount: utils.StrToFloat64(grabAmount), | |||
} | |||
@@ -246,8 +247,8 @@ func BalancePayForRedPackage(user *model.User, money string, req md.SendRedPacka | |||
//扣除用户余额 | |||
dealUserWalletReq := md2.DealUserWalletReq{ | |||
Direction: "sub", | |||
Kind: 6, | |||
Title: "领取红包收益", | |||
Kind: int(enum2.UserSendRedPackage), | |||
Title: enum2.UserSendRedPackage.String(), | |||
Uid: user.Id, | |||
Amount: utils.StrToFloat64(money), | |||
} | |||
@@ -1,5 +1,4 @@ | |||
// Code generated by swaggo/swag. DO NOT EDIT. | |||
// Package docs Code generated by swaggo/swag. DO NOT EDIT | |||
package docs | |||
import "github.com/swaggo/swag" | |||
@@ -2305,9 +2304,7 @@ const docTemplate = `{ | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"type": "object" | |||
} | |||
"schema": {} | |||
} | |||
], | |||
"responses": { | |||
@@ -2746,6 +2743,138 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/bindAlipay": { | |||
"post": { | |||
"description": "绑定支付宝", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"钱包" | |||
], | |||
"summary": "蛋蛋星球-钱包-绑定支付宝", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
}, | |||
{ | |||
"description": "具体参数", | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"$ref": "#/definitions/md.BindAlipayAccountReq" | |||
} | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "success", | |||
"schema": { | |||
"type": "string" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/bindWxPay": { | |||
"post": { | |||
"description": "绑定微信支付", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"钱包" | |||
], | |||
"summary": "蛋蛋星球-钱包-绑定微信支付", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
}, | |||
{ | |||
"description": "具体参数", | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"$ref": "#/definitions/md.BindWxPayAccountReq" | |||
} | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "success", | |||
"schema": { | |||
"type": "string" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/condition": { | |||
"get": { | |||
"description": "提现条件(获取)", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"钱包" | |||
], | |||
"summary": "蛋蛋星球-钱包-提现条件(获取)", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "具体数据", | |||
"schema": { | |||
"$ref": "#/definitions/md.GetWithdrawConditionResp" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/index": { | |||
"get": { | |||
"description": "提现余额(获取)", | |||
@@ -3045,6 +3174,48 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"md.BindAlipayAccountReq": { | |||
"type": "object", | |||
"properties": { | |||
"app_id": { | |||
"description": "支付宝商户应用appid", | |||
"type": "string" | |||
}, | |||
"ext": { | |||
"description": "拓展字段", | |||
"type": "string" | |||
}, | |||
"open_id": { | |||
"description": "支付宝用户open_id", | |||
"type": "string" | |||
}, | |||
"user_id": { | |||
"description": "支付宝用户id", | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.BindWxPayAccountReq": { | |||
"type": "object", | |||
"properties": { | |||
"app_id": { | |||
"description": "微信应用 appid", | |||
"type": "string" | |||
}, | |||
"ext": { | |||
"description": "拓展字段", | |||
"type": "string" | |||
}, | |||
"open_id": { | |||
"description": "微信用户 open_id", | |||
"type": "string" | |||
}, | |||
"user_id": { | |||
"description": "微信用户 id", | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.CollegeDetailReq": { | |||
"type": "object", | |||
"properties": { | |||
@@ -3599,6 +3770,23 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"md.GetWithdrawConditionResp": { | |||
"type": "object", | |||
"properties": { | |||
"is_bind_alipay": { | |||
"description": "是否绑定阿里账户", | |||
"type": "boolean" | |||
}, | |||
"is_bind_wx": { | |||
"description": "是否绑定微信账户", | |||
"type": "boolean" | |||
}, | |||
"is_real_name": { | |||
"description": "是否实名", | |||
"type": "boolean" | |||
} | |||
} | |||
}, | |||
"md.GrabRedPackageReq": { | |||
"type": "object", | |||
"properties": { | |||
@@ -4060,7 +4248,7 @@ const docTemplate = `{ | |||
"properties": { | |||
"auth_state": { | |||
"type": "string", | |||
"example": "0未申请 1申请中 2申请通过 3申请失败" | |||
"example": "0未审核 1通过 2拒绝" | |||
} | |||
} | |||
}, | |||
@@ -4809,6 +4997,8 @@ var SwaggerInfo = &swag.Spec{ | |||
Description: "APP客户端-Api接口", | |||
InfoInstanceName: "swagger", | |||
SwaggerTemplate: docTemplate, | |||
LeftDelim: "{{", | |||
RightDelim: "}}", | |||
} | |||
func init() { | |||
@@ -2298,9 +2298,7 @@ | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"type": "object" | |||
} | |||
"schema": {} | |||
} | |||
], | |||
"responses": { | |||
@@ -2739,6 +2737,138 @@ | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/bindAlipay": { | |||
"post": { | |||
"description": "绑定支付宝", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"钱包" | |||
], | |||
"summary": "蛋蛋星球-钱包-绑定支付宝", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
}, | |||
{ | |||
"description": "具体参数", | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"$ref": "#/definitions/md.BindAlipayAccountReq" | |||
} | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "success", | |||
"schema": { | |||
"type": "string" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/bindWxPay": { | |||
"post": { | |||
"description": "绑定微信支付", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"钱包" | |||
], | |||
"summary": "蛋蛋星球-钱包-绑定微信支付", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
}, | |||
{ | |||
"description": "具体参数", | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"$ref": "#/definitions/md.BindWxPayAccountReq" | |||
} | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "success", | |||
"schema": { | |||
"type": "string" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/condition": { | |||
"get": { | |||
"description": "提现条件(获取)", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"钱包" | |||
], | |||
"summary": "蛋蛋星球-钱包-提现条件(获取)", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "具体数据", | |||
"schema": { | |||
"$ref": "#/definitions/md.GetWithdrawConditionResp" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/v1/wallet/withdraw/index": { | |||
"get": { | |||
"description": "提现余额(获取)", | |||
@@ -3038,6 +3168,48 @@ | |||
} | |||
} | |||
}, | |||
"md.BindAlipayAccountReq": { | |||
"type": "object", | |||
"properties": { | |||
"app_id": { | |||
"description": "支付宝商户应用appid", | |||
"type": "string" | |||
}, | |||
"ext": { | |||
"description": "拓展字段", | |||
"type": "string" | |||
}, | |||
"open_id": { | |||
"description": "支付宝用户open_id", | |||
"type": "string" | |||
}, | |||
"user_id": { | |||
"description": "支付宝用户id", | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.BindWxPayAccountReq": { | |||
"type": "object", | |||
"properties": { | |||
"app_id": { | |||
"description": "微信应用 appid", | |||
"type": "string" | |||
}, | |||
"ext": { | |||
"description": "拓展字段", | |||
"type": "string" | |||
}, | |||
"open_id": { | |||
"description": "微信用户 open_id", | |||
"type": "string" | |||
}, | |||
"user_id": { | |||
"description": "微信用户 id", | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.CollegeDetailReq": { | |||
"type": "object", | |||
"properties": { | |||
@@ -3592,6 +3764,23 @@ | |||
} | |||
} | |||
}, | |||
"md.GetWithdrawConditionResp": { | |||
"type": "object", | |||
"properties": { | |||
"is_bind_alipay": { | |||
"description": "是否绑定阿里账户", | |||
"type": "boolean" | |||
}, | |||
"is_bind_wx": { | |||
"description": "是否绑定微信账户", | |||
"type": "boolean" | |||
}, | |||
"is_real_name": { | |||
"description": "是否实名", | |||
"type": "boolean" | |||
} | |||
} | |||
}, | |||
"md.GrabRedPackageReq": { | |||
"type": "object", | |||
"properties": { | |||
@@ -4053,7 +4242,7 @@ | |||
"properties": { | |||
"auth_state": { | |||
"type": "string", | |||
"example": "0未申请 1申请中 2申请通过 3申请失败" | |||
"example": "0未审核 1通过 2拒绝" | |||
} | |||
} | |||
}, | |||
@@ -153,6 +153,36 @@ definitions: | |||
description: 收益倒计时 | |||
type: string | |||
type: object | |||
md.BindAlipayAccountReq: | |||
properties: | |||
app_id: | |||
description: 支付宝商户应用appid | |||
type: string | |||
ext: | |||
description: 拓展字段 | |||
type: string | |||
open_id: | |||
description: 支付宝用户open_id | |||
type: string | |||
user_id: | |||
description: 支付宝用户id | |||
type: string | |||
type: object | |||
md.BindWxPayAccountReq: | |||
properties: | |||
app_id: | |||
description: 微信应用 appid | |||
type: string | |||
ext: | |||
description: 拓展字段 | |||
type: string | |||
open_id: | |||
description: 微信用户 open_id | |||
type: string | |||
user_id: | |||
description: 微信用户 id | |||
type: string | |||
type: object | |||
md.CollegeDetailReq: | |||
properties: | |||
id: | |||
@@ -535,6 +565,18 @@ definitions: | |||
items: {} | |||
type: array | |||
type: object | |||
md.GetWithdrawConditionResp: | |||
properties: | |||
is_bind_alipay: | |||
description: 是否绑定阿里账户 | |||
type: boolean | |||
is_bind_wx: | |||
description: 是否绑定微信账户 | |||
type: boolean | |||
is_real_name: | |||
description: 是否实名 | |||
type: boolean | |||
type: object | |||
md.GrabRedPackageReq: | |||
properties: | |||
device_id: | |||
@@ -855,7 +897,7 @@ definitions: | |||
md.RealNameAuthBasicData: | |||
properties: | |||
auth_state: | |||
example: 0未申请 1申请中 2申请通过 3申请失败 | |||
example: 0未审核 1通过 2拒绝 | |||
type: string | |||
type: object | |||
md.RealNameAuthResp: | |||
@@ -2874,8 +2916,7 @@ paths: | |||
in: body | |||
name: req | |||
required: true | |||
schema: | |||
type: object | |||
schema: {} | |||
produces: | |||
- application/json | |||
responses: | |||
@@ -3168,6 +3209,93 @@ paths: | |||
summary: 蛋蛋星球-钱包-发起提现 | |||
tags: | |||
- 钱包 | |||
/api/v1/wallet/withdraw/bindAlipay: | |||
post: | |||
consumes: | |||
- application/json | |||
description: 绑定支付宝 | |||
parameters: | |||
- description: 验证参数Bearer和token空格拼接 | |||
in: header | |||
name: Authorization | |||
required: true | |||
type: string | |||
- description: 具体参数 | |||
in: body | |||
name: req | |||
required: true | |||
schema: | |||
$ref: '#/definitions/md.BindAlipayAccountReq' | |||
produces: | |||
- application/json | |||
responses: | |||
"200": | |||
description: success | |||
schema: | |||
type: string | |||
"400": | |||
description: 具体错误 | |||
schema: | |||
$ref: '#/definitions/md.Response' | |||
summary: 蛋蛋星球-钱包-绑定支付宝 | |||
tags: | |||
- 钱包 | |||
/api/v1/wallet/withdraw/bindWxPay: | |||
post: | |||
consumes: | |||
- application/json | |||
description: 绑定微信支付 | |||
parameters: | |||
- description: 验证参数Bearer和token空格拼接 | |||
in: header | |||
name: Authorization | |||
required: true | |||
type: string | |||
- description: 具体参数 | |||
in: body | |||
name: req | |||
required: true | |||
schema: | |||
$ref: '#/definitions/md.BindWxPayAccountReq' | |||
produces: | |||
- application/json | |||
responses: | |||
"200": | |||
description: success | |||
schema: | |||
type: string | |||
"400": | |||
description: 具体错误 | |||
schema: | |||
$ref: '#/definitions/md.Response' | |||
summary: 蛋蛋星球-钱包-绑定微信支付 | |||
tags: | |||
- 钱包 | |||
/api/v1/wallet/withdraw/condition: | |||
get: | |||
consumes: | |||
- application/json | |||
description: 提现条件(获取) | |||
parameters: | |||
- description: 验证参数Bearer和token空格拼接 | |||
in: header | |||
name: Authorization | |||
required: true | |||
type: string | |||
produces: | |||
- application/json | |||
responses: | |||
"200": | |||
description: 具体数据 | |||
schema: | |||
$ref: '#/definitions/md.GetWithdrawConditionResp' | |||
"400": | |||
description: 具体错误 | |||
schema: | |||
$ref: '#/definitions/md.Response' | |||
summary: 蛋蛋星球-钱包-提现条件(获取) | |||
tags: | |||
- 钱包 | |||
/api/v1/wallet/withdraw/index: | |||
get: | |||
consumes: | |||
@@ -1,10 +1,11 @@ | |||
module applet | |||
go 1.19 | |||
go 1.21 | |||
toolchain go1.23.2 | |||
//replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models | |||
// | |||
//replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules | |||
require ( | |||
@@ -41,6 +42,7 @@ require ( | |||
github.com/gin-contrib/sessions v1.0.1 | |||
github.com/go-pay/crypto v0.0.1 | |||
github.com/go-pay/gopay v1.5.98 | |||
github.com/go-pay/xlog v0.0.3 | |||
github.com/go-pay/xtime v0.0.2 | |||
github.com/go-sql-driver/mysql v1.8.1 | |||
github.com/gocolly/colly v1.2.0 | |||