1
This commit is contained in:
parent
1d26b220ea
commit
cbda367a33
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user