From cbda367a3320614557717e12c4c9bdd7133c3e0d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 11 Nov 2024 17:03:23 +0800 Subject: [PATCH] 1 --- server/wheelserver/api/v1/shop/shop.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/wheelserver/api/v1/shop/shop.go b/server/wheelserver/api/v1/shop/shop.go index ac9a9729..a534c10c 100644 --- a/server/wheelserver/api/v1/shop/shop.go +++ b/server/wheelserver/api/v1/shop/shop.go @@ -2,10 +2,12 @@ package shop import ( "q5" + "f5" "main/constant" "main/common" "main/vo" "main/mt" + "main/model" "github.com/gin-gonic/gin" ) @@ -34,4 +36,20 @@ func (this *ShopApi) Goods(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) }