This commit is contained in:
aozhiwei 2024-11-27 16:23:57 +08:00
parent f1817da7fc
commit 76d0ba767d

View File

@ -4,11 +4,11 @@ import (
"f5" "f5"
"main/constant" "main/constant"
"main/common" "main/common"
"main/mt"
/* /*
"main/vo" "main/vo"
"main/model" "main/model"
"math/rand" "math/rand"
"main/mt"
"main/service" "main/service"
*/ */
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -23,10 +23,20 @@ func (this *InAppShopApi) Purchase(c *gin.Context) {
return return
} }
reqJson := struct { reqJson := struct {
ForwardPoint int32 `json:"forward_point"` GoodsId int32 `json:"goods_id"`
GoodsNum int32 `json:"goods_num"`
}{} }{}
if err := c.ShouldBindJSON(&reqJson); err != nil { if err := c.ShouldBindJSON(&reqJson); err != nil {
f5.RspErr(c, 401, "params parse error") f5.RspErr(c, 401, "params parse error")
return return
} }
goodsMeta := mt.Table.ShopGoods.GetById(int64(reqJson.GoodsId))
if goodsMeta == nil {
f5.RspErr(c, 401, "goodsId params error")
return
}
if reqJson.GoodsNum != 1 {
f5.RspErr(c, 401, "goodsNum params error")
return
}
} }