This commit is contained in:
aozhiwei 2024-11-11 16:04:22 +08:00
parent 4f6aee7c28
commit 69907abec1

View File

@ -1,9 +1,11 @@
package shop
import (
"q5"
"main/constant"
"main/common"
"main/vo"
"main/mt"
"github.com/gin-gonic/gin"
)
@ -17,7 +19,13 @@ func (this *ShopApi) Goods(c *gin.Context) {
}
rspObj := struct {
vo.BaseVo
Goods []*vo.Goods `json:"goods"`
Data []*vo.Goods `json:"goods"`
}{}
mt.Table.Item.Traverse(func (itemMeta *mt.Item) bool {
goodsVo := new(vo.Goods)
goodsVo.ItemId = itemMeta.GetId()
q5.AppendSlice(&rspObj.Data, goodsVo)
return true
})
c.JSON(200, rspObj)
}