fix: fix&refactor

This commit is contained in:
Vyacheslav1557 2025-03-29 03:28:30 +05:00
parent 5536c086e0
commit 318599cfea
5 changed files with 84 additions and 52 deletions

View file

@ -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
}