mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-10 03:03:43 +08:00
refactor: 管理后台用户列表页面重构
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package vo
|
||||
|
||||
import "math"
|
||||
|
||||
type Page struct {
|
||||
Items interface{} `json:"items"`
|
||||
Page int `json:"page"`
|
||||
@@ -9,12 +11,12 @@ type Page struct {
|
||||
}
|
||||
|
||||
func NewPage(total int64, page int, pageSize int, items interface{}) Page {
|
||||
totalPage := int(total / int64(pageSize))
|
||||
totalPage := math.Ceil(float64(total) / float64(pageSize))
|
||||
return Page{
|
||||
Items: items,
|
||||
Page: page,
|
||||
PageSize: pageSize,
|
||||
Total: total,
|
||||
TotalPage: totalPage,
|
||||
TotalPage: int(totalPage),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user