From f7fd8dc29e092dbc49cd938d40d93cd0fcb8f226 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Fri, 17 Nov 2023 17:14:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E:=E6=9D=83=E9=99=90=E5=88=86?= =?UTF-8?q?=E7=BB=84=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/ldap-admin/internal/logic/getapislogic.go | 4 +--- server/ldap-admin/internal/logic/getldapgroupslogic.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/server/ldap-admin/internal/logic/getapislogic.go b/server/ldap-admin/internal/logic/getapislogic.go index 95857faa..01aea888 100644 --- a/server/ldap-admin/internal/logic/getapislogic.go +++ b/server/ldap-admin/internal/logic/getapislogic.go @@ -44,9 +44,7 @@ func (l *GetApisLogic) GetApis(req *types.GetApisReq, userinfo *auth.UserInfo) ( } var pageCount int = 1 if resCount > int64(req.PerPage) { - var float64Count = float64(resCount) - var float64PerPage = float64(req.PerPage) - pageCountFloat := math.Ceil(float64Count / float64PerPage) + pageCountFloat := math.Ceil(float64(resCount) / float64(req.PerPage)) pageCount = int(pageCountFloat) } diff --git a/server/ldap-admin/internal/logic/getldapgroupslogic.go b/server/ldap-admin/internal/logic/getldapgroupslogic.go index 14918fc1..d610cfb6 100644 --- a/server/ldap-admin/internal/logic/getldapgroupslogic.go +++ b/server/ldap-admin/internal/logic/getldapgroupslogic.go @@ -45,9 +45,7 @@ func (l *GetLdapGroupsLogic) GetLdapGroups(req *types.GetLdapGroupsReq, userinfo } var pageCount int = 1 if resCount > int64(req.PerPage) { - var float64Count = float64(resCount) - var float64PerPage = float64(req.PerPage) - pageCountFloat := math.Ceil(float64Count / float64PerPage) + pageCountFloat := math.Ceil(float64(resCount) / float64(req.PerPage)) pageCount = int(pageCountFloat) }