diff --git a/server/ldap-admin/internal/logic/getapislogic.go b/server/ldap-admin/internal/logic/getapislogic.go index 01aea888..8e0f5e6e 100644 --- a/server/ldap-admin/internal/logic/getapislogic.go +++ b/server/ldap-admin/internal/logic/getapislogic.go @@ -44,8 +44,7 @@ func (l *GetApisLogic) GetApis(req *types.GetApisReq, userinfo *auth.UserInfo) ( } var pageCount int = 1 if resCount > int64(req.PerPage) { - pageCountFloat := math.Ceil(float64(resCount) / float64(req.PerPage)) - pageCount = int(pageCountFloat) + pageCount = int(math.Ceil(float64(resCount) / float64(req.PerPage))) } return resp.SetStatus(basic.CodeOK, map[string]interface{}{ diff --git a/server/ldap-admin/internal/logic/getldapgroupslogic.go b/server/ldap-admin/internal/logic/getldapgroupslogic.go index d610cfb6..57de24d0 100644 --- a/server/ldap-admin/internal/logic/getldapgroupslogic.go +++ b/server/ldap-admin/internal/logic/getldapgroupslogic.go @@ -45,8 +45,7 @@ func (l *GetLdapGroupsLogic) GetLdapGroups(req *types.GetLdapGroupsReq, userinfo } var pageCount int = 1 if resCount > int64(req.PerPage) { - pageCountFloat := math.Ceil(float64(resCount) / float64(req.PerPage)) - pageCount = int(pageCountFloat) + pageCount = int(math.Ceil(float64(resCount) / float64(req.PerPage))) } return resp.SetStatus(basic.CodeOK, map[string]interface{}{