From 8d767467fc5f07392a301c53cc8b533e222ef2b4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 13 Aug 2024 15:22:53 +0800 Subject: [PATCH] 1 --- .../marketserver/api/v1/recharge/recharge.go | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/server/marketserver/api/v1/recharge/recharge.go b/server/marketserver/api/v1/recharge/recharge.go index 4055023c..5d1a216c 100644 --- a/server/marketserver/api/v1/recharge/recharge.go +++ b/server/marketserver/api/v1/recharge/recharge.go @@ -49,17 +49,19 @@ func (ea *RechargeApi) RechargeList(c *gin.Context) { } func (this *RechargeApi) Buy(c *gin.Context) { - //passportAddress := c.MustGet("account_address").(string) - // reqJson := struct { - // NetId int32 `json:"net_id"` - // GoodsId int32 `json:"goods_id"` - // Num int32 `json:"goods_num"` - // AccountAddress string `json:"account_address"` - // }{} - // if err := c.ShouldBindJSON(&reqJson); err != nil { - // f5.RspErr(c, 1, err.Error()) - // return - // } + passportAddress := c.MustGet("account_address").(string) + reqJson := struct { + NetId int32 `json:"net_id"` + GoodsId int32 `json:"goods_id"` + GoodsNum int32 `json:"goods_num"` + AccountAddress string `json:"account_address"` + }{} + if err := c.ShouldBindJSON(&reqJson); err != nil { + f5.RspErr(c, 1, err.Error()) + return + } + this.internalBuy(c, reqJson.NetId, reqJson.GoodsId, reqJson.GoodsNum, + reqJson.AccountAddress, passportAddress, "") } func (this *RechargeApi) BuyWithEmail(c *gin.Context) {