Przeglądaj źródła

update

adv_callback
shenjiachi 1 miesiąc temu
rodzic
commit
9a305c101a
4 zmienionych plików z 44 dodań i 1 usunięć
  1. +35
    -0
      app/hdl/hdl_wallet.go
  2. +4
    -0
      app/md/md.wallet.go
  3. +4
    -0
      app/router/router.go
  4. +1
    -1
      go.mod

+ 35
- 0
app/hdl/hdl_wallet.go Wyświetl plik

@@ -92,3 +92,38 @@ func GetAmountFlow(c *gin.Context) {
}
e.OutSuc(c, resp, nil)
}

// WithdrawGetAmount
// @Summary 蛋蛋星球-钱包-提现余额(获取)
// @Tags 钱包
// @Description 提现余额(获取)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} md.WithdrawGetAmountResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/wallet/withdraw/index [GET]
func WithdrawGetAmount(c *gin.Context) {
val, exists := c.Get("user")
if !exists {
e.OutErr(c, e.ERR_USER_CHECK_ERR, nil)
return
}
user, ok := val.(*model.User)
if !ok {
e.OutErr(c, e.ERR_USER_CHECK_ERR, nil)
return
}

walletDb := implement.NewUserWalletDb(db.Db)
wallet, err := walletDb.GetUserVirtualWallet(user.Id)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}

resp := md.WithdrawGetAmountResp{
Amount: wallet.Amount,
}
e.OutSuc(c, resp, nil)
}

+ 4
- 0
app/md/md.wallet.go Wyświetl plik

@@ -21,3 +21,7 @@ type GetAmountFlowResp struct {
List []WalletFlowNode `json:"list"`
Paginate Paginate `json:"paginate"`
}

type WithdrawGetAmountResp struct {
Amount string `json:"amount"` // 余额
}

+ 4
- 0
app/router/router.go Wyświetl plik

@@ -107,6 +107,10 @@ func route(r *gin.RouterGroup) {
rWallet := r.Group("/wallet") // 钱包
{
rWallet.GET("/amountFlow", hdl.GetAmountFlow) // 余额流水
rWithdraw := r.Group("/withdraw")
{
rWithdraw.GET("/index", hdl.WithdrawGetAmount)
}
}
rRedPacket := r.Group("/redPacket") // 红包
{


+ 1
- 1
go.mod Wyświetl plik

@@ -33,7 +33,7 @@ require (

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241125034400-ef18ee319fd2
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241123093218-87b65e51eea3
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241125081706-0915be3f4144
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


Ładowanie…
Anuluj
Zapisz