代码拉取完成,页面将自动刷新
/*
@Time : 2020/9/26 12:52
@Author : douxuefeng
@File : page
@Desc:
*/
package go_common
import "math"
type Page struct {
CurrentPage int `json:"current_page"`
Total int64 `json:"total"`
Data interface{} `json:"data"`
PerPage int `json:"per_page"`
LastPage int `json:"last_page"`
}
func LastPage(total int64, pageSize int) int {
return int(math.Ceil(float64(total) / float64(pageSize)))
}
func GetPage(total int64, currentPage,perPage,lastPage int, data interface{} ) *Page {
return &Page{
CurrentPage: currentPage,
Total: total,
Data: data,
PerPage: perPage,
LastPage: lastPage,
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。