This commit is contained in:
aozhiwei 2024-11-11 17:03:23 +08:00
parent 1d26b220ea
commit cbda367a33

View File

@ -2,10 +2,12 @@ package shop
import ( import (
"q5" "q5"
"f5"
"main/constant" "main/constant"
"main/common" "main/common"
"main/vo" "main/vo"
"main/mt" "main/mt"
"main/model"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -34,4 +36,20 @@ func (this *ShopApi) Goods(c *gin.Context) {
} }
func (this *ShopApi) Buy(c *gin.Context) { func (this *ShopApi) Buy(c *gin.Context) {
s := c.MustGet(constant.SESSION_KEY).(common.Session)
if s == nil {
return
}
rspObj := struct {
vo.BaseVo
}{}
user := new(model.User)
nowTime := f5.GetApp().GetRealSeconds()
if err, found := user.Find(s.GetAccountId(), nowTime); err != nil {
f5.RspErr(c, 500, "server internal error")
return
} else if !found {
f5.RspErr(c, 500, "server internal error")
}
c.JSON(200, rspObj)
} }