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) {