增加计算相关
This commit is contained in:
parent
3cfcad0c65
commit
29b0f171ff
29
calculate.go
Normal file
29
calculate.go
Normal file
@ -0,0 +1,29 @@
|
||||
// Package util ...
|
||||
//
|
||||
// Description : util ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2022-07-17 15:49
|
||||
package util
|
||||
|
||||
// calculate 各种计算相关
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:49 2022/7/17
|
||||
type calculate struct {
|
||||
}
|
||||
|
||||
// GetTotalPage 获取总页码数
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:50 2022/7/17
|
||||
func (c *calculate) GetTotalPage(total int64, pageSize int64) int64 {
|
||||
totalPage := total / pageSize
|
||||
if total%pageSize > 0 {
|
||||
totalPage++
|
||||
}
|
||||
return totalPage
|
||||
}
|
Loading…
Reference in New Issue
Block a user