新增:权限分组模块

This commit is contained in:
momo 2023-11-17 17:14:33 +08:00
parent 959ec41656
commit f7fd8dc29e
2 changed files with 2 additions and 6 deletions

View File

@ -44,9 +44,7 @@ func (l *GetApisLogic) GetApis(req *types.GetApisReq, userinfo *auth.UserInfo) (
} }
var pageCount int = 1 var pageCount int = 1
if resCount > int64(req.PerPage) { if resCount > int64(req.PerPage) {
var float64Count = float64(resCount) pageCountFloat := math.Ceil(float64(resCount) / float64(req.PerPage))
var float64PerPage = float64(req.PerPage)
pageCountFloat := math.Ceil(float64Count / float64PerPage)
pageCount = int(pageCountFloat) pageCount = int(pageCountFloat)
} }

View File

@ -45,9 +45,7 @@ func (l *GetLdapGroupsLogic) GetLdapGroups(req *types.GetLdapGroupsReq, userinfo
} }
var pageCount int = 1 var pageCount int = 1
if resCount > int64(req.PerPage) { if resCount > int64(req.PerPage) {
var float64Count = float64(resCount) pageCountFloat := math.Ceil(float64(resCount) / float64(req.PerPage))
var float64PerPage = float64(req.PerPage)
pageCountFloat := math.Ceil(float64Count / float64PerPage)
pageCount = int(pageCountFloat) pageCount = int(pageCountFloat)
} }