Browse Source

update

adv_callback
dengbiao 2 weeks ago
parent
commit
5398616fc2
7 changed files with 16 additions and 30 deletions
  1. +3
    -19
      app/hdl/hdl_wallet.go
  2. +3
    -1
      app/lib/auth/auth.go
  3. +1
    -1
      app/lib/gopay/init_alipay.go
  4. +1
    -1
      app/lib/gopay/utils_test.go
  5. +1
    -1
      app/svc/svc_withdraw_apply.go
  6. +7
    -7
      go.mod
  7. BIN
     

+ 3
- 19
app/hdl/hdl_wallet.go View File

@@ -1,6 +1,7 @@
package hdl

import (
"applet/app/cfg"
"applet/app/db"
"applet/app/e"
alipay "applet/app/lib/gopay"
@@ -10,6 +11,7 @@ import (
"applet/app/utils/cache"
"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"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
enum2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
@@ -164,25 +166,6 @@ func WithdrawApply(c *gin.Context) {
return
}
user := svc.GetUser(c)
//1. 判断是否为第一次提现
isFirst := false
has, err := db.Db.Where("uid = ?", user.Id).
Get(model.FinWithdrawApply{})
if !has { //第一次提现
isFirst = true
}
settingDb := implement.NewFinWithdrawSettingDb(db.Db)
setting, err := settingDb.FinWithdrawSettingGetOne()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err)
return
}
resp := svc.GetWithdrawCondition(user, setting, isFirst)
//判断实名
if user.IsRealName != 1 && resp.IsNeedRealName {
e.OutErr(c, 400, e.NewErr(400, "请先前往实名认证"))
return
}
var userId, openId string
var kind int
//sysCfgDb := implement.NewSysCfgDb(db.Db, cache.GetPool().Get())
@@ -259,6 +242,7 @@ func WithdrawApply(c *gin.Context) {
Uid: user.Id,
Amount: utils.StrToFloat64(req.Amount),
}
rule2.Init(cfg.RedisAddr)
err = rule.DealUserWallet(session, dealUserWalletReq)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 3
- 1
app/lib/auth/auth.go View File

@@ -52,10 +52,12 @@ func ParseToken(tokenString string) (*JWTUser, string, error) {
//TODO::单设备验证
cacheKey := fmt.Sprintf(TokenKey, claims.Uid)
cJwt, err1 := cache.GetString(cacheKey)
if err != nil {
if err1 != nil {
return nil, "", err1
}
if cJwt != tokenString && cJwt != "" {
fmt.Println(cJwt)
fmt.Println(tokenString)
return nil, "", errors.New("token expired")
}



+ 1
- 1
app/lib/gopay/init_alipay.go View File

@@ -7,7 +7,7 @@ import (
"code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
"github.com/go-pay/gopay"
"github.com/go-pay/gopay/alipay"
"github.com/go-pay/gopay/pkg/xlog"
"github.com/go-pay/xlog"
)

type InitAlipayStruct struct {


+ 1
- 1
app/lib/gopay/utils_test.go View File

@@ -3,7 +3,7 @@ package alipay
import (
"context"
"github.com/go-pay/gopay"
"github.com/go-pay/gopay/pkg/xlog"
"github.com/go-pay/xlog"
"testing"
)



+ 1
- 1
app/svc/svc_withdraw_apply.go View File

@@ -32,7 +32,7 @@ func CheckWithdraw(c *gin.Context, amount string) (err error, realAmount, fee st

//2、判断是否为第一次提现
var isCompleteFirstWithdraw bool
has, err := db.Db.Where("uid =?", user.Id).Get(model.FinWithdrawApply{})
has, err := db.Db.Where("uid =?", user.Id).Get(&model.FinWithdrawApply{})
if !has { //第一次提现
isFirst = true
var firstWithdrawSet md.FirstWithdrawSet


+ 7
- 7
go.mod View File

@@ -1,8 +1,6 @@
module applet

go 1.21

toolchain go1.23.2
go 1.19

//replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models

@@ -17,7 +15,7 @@ require (
github.com/go-playground/universal-translator v0.18.1
github.com/go-playground/validator/v10 v10.20.0
github.com/go-redis/redis v6.15.9+incompatible
github.com/gomodule/redigo v1.9.2
github.com/gomodule/redigo v2.0.0+incompatible
github.com/jinzhu/copier v0.4.0
github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831
github.com/qiniu/api.v7/v7 v7.8.2
@@ -35,12 +33,14 @@ require (

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241203152302-b6aa8333c67e
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241204064333-9ce6762e478f
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241204070258-4712985349b4
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
github.com/gin-contrib/sessions v1.0.1
github.com/go-pay/crypto v0.0.1
github.com/go-pay/gopay v1.5.106
github.com/go-pay/gopay v1.5.101
github.com/go-pay/xlog v0.0.2
github.com/go-pay/xtime v0.0.2
github.com/go-sql-driver/mysql v1.8.1
github.com/gocolly/colly v1.2.0
@@ -116,7 +116,7 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.8.0 // indirect


BIN
View File


Loading…
Cancel
Save