fix: fix&refactor
This commit is contained in:
parent
5536c086e0
commit
318599cfea
5 changed files with 84 additions and 52 deletions
|
@ -4,3 +4,10 @@ type Pagination struct {
|
|||
Page int32 `json:"page"`
|
||||
Total int32 `json:"total"`
|
||||
}
|
||||
|
||||
func Total(count int32, pageSize int32) int32 {
|
||||
if count%pageSize == 0 {
|
||||
return count / pageSize
|
||||
}
|
||||
return count/pageSize + 1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue