1
This commit is contained in:
parent
f70201abb1
commit
eaf03ec09c
@ -8,6 +8,7 @@ import (
|
||||
"main/model"
|
||||
"main/vo"
|
||||
"main/service"
|
||||
"main/mt"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@ -49,10 +50,10 @@ func (this *BagApi) UseItem(c *gin.Context) {
|
||||
f5.RspErr(c, 401, "params parse error")
|
||||
return
|
||||
}
|
||||
bagItem := new(model.Bag)
|
||||
rspObj := struct {
|
||||
vo.BaseVo
|
||||
}{}
|
||||
bagItem := new(model.Bag)
|
||||
if err, found := bagItem.FindByItemUniId(s.GetAccountId(), q5.ToInt64(reqJson.ItemUniId)); err != nil {
|
||||
f5.RspErr(c, 500, "server internal error")
|
||||
return
|
||||
@ -64,5 +65,10 @@ func (this *BagApi) UseItem(c *gin.Context) {
|
||||
f5.RspErr(c, 1, "item not enough")
|
||||
return
|
||||
}
|
||||
itemMeta := mt.Table.Item.GetById(int64(bagItem.ItemId))
|
||||
if itemMeta == nil {
|
||||
f5.RspErr(c, 500, "server internal error")
|
||||
return
|
||||
}
|
||||
c.JSON(200, rspObj)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user