This commit is contained in:
aozhiwei 2024-07-16 17:56:21 +08:00
parent d9bcf821fd
commit 68a1dec5ab

View File

@ -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)
})
}