提交 560e08e0 authored 作者: mooncake's avatar mooncake

fix

上级 b961746b
...@@ -229,6 +229,12 @@ func SuccessWithPage[T any](c *gin.Context, list []*T, total int64) { ...@@ -229,6 +229,12 @@ func SuccessWithPage[T any](c *gin.Context, list []*T, total int64) {
} }
} }
} }
if pageIndex <= 0 {
pageIndex = 1
}
if pageSize <= 0 {
pageSize = 10
}
pageTotal := total / int64(pageSize) pageTotal := total / int64(pageSize)
if total%int64(pageSize) > 0 { if total%int64(pageSize) > 0 {
pageTotal = pageTotal + 1 pageTotal = pageTotal + 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论