1
This commit is contained in:
parent
f1817da7fc
commit
76d0ba767d
@ -4,11 +4,11 @@ import (
|
||||
"f5"
|
||||
"main/constant"
|
||||
"main/common"
|
||||
"main/mt"
|
||||
/*
|
||||
"main/vo"
|
||||
"main/model"
|
||||
"math/rand"
|
||||
"main/mt"
|
||||
"main/service"
|
||||
*/
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -23,10 +23,20 @@ func (this *InAppShopApi) Purchase(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
reqJson := struct {
|
||||
ForwardPoint int32 `json:"forward_point"`
|
||||
GoodsId int32 `json:"goods_id"`
|
||||
GoodsNum int32 `json:"goods_num"`
|
||||
}{}
|
||||
if err := c.ShouldBindJSON(&reqJson); err != nil {
|
||||
f5.RspErr(c, 401, "params parse error")
|
||||
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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user