@@ -92,3 +92,38 @@ func GetAmountFlow(c *gin.Context) { | |||||
} | } | ||||
e.OutSuc(c, resp, nil) | 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) | |||||
} |
@@ -21,3 +21,7 @@ type GetAmountFlowResp struct { | |||||
List []WalletFlowNode `json:"list"` | List []WalletFlowNode `json:"list"` | ||||
Paginate Paginate `json:"paginate"` | Paginate Paginate `json:"paginate"` | ||||
} | } | ||||
type WithdrawGetAmountResp struct { | |||||
Amount string `json:"amount"` // 余额 | |||||
} |
@@ -107,6 +107,10 @@ func route(r *gin.RouterGroup) { | |||||
rWallet := r.Group("/wallet") // 钱包 | rWallet := r.Group("/wallet") // 钱包 | ||||
{ | { | ||||
rWallet.GET("/amountFlow", hdl.GetAmountFlow) // 余额流水 | rWallet.GET("/amountFlow", hdl.GetAmountFlow) // 余额流水 | ||||
rWithdraw := r.Group("/withdraw") | |||||
{ | |||||
rWithdraw.GET("/index", hdl.WithdrawGetAmount) | |||||
} | |||||
} | } | ||||
rRedPacket := r.Group("/redPacket") // 红包 | rRedPacket := r.Group("/redPacket") // 红包 | ||||
{ | { | ||||
@@ -33,7 +33,7 @@ require ( | |||||
require ( | require ( | ||||
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241125034400-ef18ee319fd2 | 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_es.git v1.0.1-0.20241118083738-0f22da9ba0be | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 | 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/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible | ||||