|
|
@@ -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) |
|
|
|
} |