diff --git a/server/marketserver/api/v1/ingame/ingame.go b/server/marketserver/api/v1/ingame/ingame.go index 6956e912..328bd0ee 100644 --- a/server/marketserver/api/v1/ingame/ingame.go +++ b/server/marketserver/api/v1/ingame/ingame.go @@ -3,6 +3,7 @@ package ingame import ( "q5" "f5" + "main/common" . "main/global" "github.com/gin-gonic/gin" ) @@ -38,6 +39,15 @@ func (this *InGameApi) HeroList(c *gin.Context) { f5.RspErr(c, 500, "server internal error") return } + + rspObj := struct { + ErrCode int32 `json:"errcode"` + ErrMsg string `json:"errmsg"` + Page common.StreamPagination `json:"page"` + Rows [] interface{} `json:"rows"` + }{} + q5.NewSlice(&rspObj.Rows, 0, 10) + f5.DataSetStreamPageQuery( heroList, q5.SafeToInt32(reqJson.PageSize), @@ -49,9 +59,10 @@ func (this *InGameApi) HeroList(c *gin.Context) { return true }, func (p *f5.StreamPagination) { + rspObj.Page.FillPage(p) }, func (row interface{}) { - + q5.AppendSlice(&rspObj.Rows, row) }) }