mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 10:43:44 +08:00
refactor: V3 版本重构已基本完成
This commit is contained in:
20
api/go/store/vo/page.go
Normal file
20
api/go/store/vo/page.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package vo
|
||||
|
||||
type Page struct {
|
||||
Items interface{} `json:"items"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
Total int64 `json:"total"`
|
||||
TotalPage int `json:"total_page"`
|
||||
}
|
||||
|
||||
func NewPage(total int64, page int, pageSize int, items interface{}) Page {
|
||||
totalPage := int(total / int64(pageSize))
|
||||
return Page{
|
||||
Items: items,
|
||||
Page: page,
|
||||
PageSize: pageSize,
|
||||
Total: total,
|
||||
TotalPage: totalPage,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user