From 458cf59e067e7f042b847ba4b106736aea6f6888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Tue, 19 Jul 2022 11:47:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A3=9E=E4=B9=A6?= =?UTF-8?q?=E6=A0=B9=E9=83=A8=E9=97=A8=E7=94=A8=E6=88=B7=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/client/feishu/feishu.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/client/feishu/feishu.go b/public/client/feishu/feishu.go index 2630b86..0a01512 100644 --- a/public/client/feishu/feishu.go +++ b/public/client/feishu/feishu.go @@ -57,11 +57,18 @@ func GetAllUsers() (ret []map[string]interface{}, err error) { if err != nil { return nil, err } + + deptids := make([]string, 0) + deptids = append(deptids, "0") // 0 代表根部门 for _, dept := range depts { + deptids = append(deptids, dept["open_department_id"].(string)) + } + + for _, deptid := range deptids { req := lark.GetUserListReq{ PageSize: &pageSize, PageToken: new(string), - DepartmentID: dept["open_department_id"].(string), + DepartmentID: deptid, } for { res, _, err := InitFeiShuClient().Contact.GetUserList(context.Background(), &req)