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 ( import (
"q5" "q5"
"f5" "f5"
"main/common"
. "main/global" . "main/global"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -38,6 +39,15 @@ func (this *InGameApi) HeroList(c *gin.Context) {
f5.RspErr(c, 500, "server internal error") f5.RspErr(c, 500, "server internal error")
return 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( f5.DataSetStreamPageQuery(
heroList, heroList,
q5.SafeToInt32(reqJson.PageSize), q5.SafeToInt32(reqJson.PageSize),
@ -49,9 +59,10 @@ func (this *InGameApi) HeroList(c *gin.Context) {
return true return true
}, },
func (p *f5.StreamPagination) { func (p *f5.StreamPagination) {
rspObj.Page.FillPage(p)
}, },
func (row interface{}) { func (row interface{}) {
q5.AppendSlice(&rspObj.Rows, row)
}) })
} }