This commit is contained in:
aozhiwei 2024-06-29 16:58:36 +08:00
parent faa5f840af
commit 191048f40d
2 changed files with 2 additions and 0 deletions

View File

@ -387,6 +387,7 @@ func (this *dbPool) StreamPageQuery(
pagination.PreviousCursor = cursor
for rows.Next() {
if (rows.NumOfReaded() <= int64(pageSize)) {
pagination.Count += 1
fillCb(rows)
if (rows.NumOfReaded() == int64(pageSize)) {
pagination.NextCursor = q5.ToInt64(rows.GetByName("idx"))

View File

@ -32,6 +32,7 @@ type StreamPagination struct {
NextCursor int64
PreviousCursor int64
Remaining int32
Count int32
}
type GinHandlerFunc func(*gin.Context)