From 81d571472c9166206ebd41b607c8f70d21b4dd09 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, 5 Jul 2022 09:30:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=86=E7=BB=84name=5Fpiny?= =?UTF-8?q?in=E7=9A=84=E5=AD=97=E6=AE=B5=E5=90=8D=20(#56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/client/dingtalk/dingtalk.go | 2 +- public/client/feishu/feishu.go | 2 +- public/client/wechat/wecom.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/client/dingtalk/dingtalk.go b/public/client/dingtalk/dingtalk.go index adc40d1..580ceb0 100644 --- a/public/client/dingtalk/dingtalk.go +++ b/public/client/dingtalk/dingtalk.go @@ -20,9 +20,9 @@ func GetAllDepts() (ret []map[string]interface{}, err error) { for _, dept := range depts.Dept { ele := make(map[string]interface{}) ele["id"] = dept.Id - ele["name_pinyin"] = strings.Join(pinyin.LazyConvert(dept.Name, nil), "") ele["name"] = dept.Name ele["parentid"] = dept.ParentId + ele["custom_name_pinyin"] = strings.Join(pinyin.LazyConvert(dept.Name, nil), "") ret = append(ret, ele) } return diff --git a/public/client/feishu/feishu.go b/public/client/feishu/feishu.go index 15e1a47..98ad47a 100644 --- a/public/client/feishu/feishu.go +++ b/public/client/feishu/feishu.go @@ -31,7 +31,7 @@ func GetAllDepts() (ret []map[string]interface{}, err error) { for _, dept := range res.Items { ele := make(map[string]interface{}) ele["name"] = dept.Name - ele["name_pinyin"] = strings.Join(pinyin.LazyConvert(dept.Name, nil), "") + ele["custom_name_pinyin"] = strings.Join(pinyin.LazyConvert(dept.Name, nil), "") ele["parent_department_id"] = dept.ParentDepartmentID ele["department_id"] = dept.DepartmentID ele["open_department_id"] = dept.OpenDepartmentID diff --git a/public/client/wechat/wecom.go b/public/client/wechat/wecom.go index 22b331c..8c9d750 100644 --- a/public/client/wechat/wecom.go +++ b/public/client/wechat/wecom.go @@ -21,7 +21,7 @@ func GetAllDepts() (ret []map[string]interface{}, err error) { for _, dept := range depts.Department { ele := make(map[string]interface{}) ele["name"] = dept.Name - ele["name_pinyin"] = strings.Join(pinyin.LazyConvert(dept.Name, nil), "") + ele["custom_name_pinyin"] = strings.Join(pinyin.LazyConvert(dept.Name, nil), "") ele["id"] = dept.ID ele["name_en"] = dept.NameEn ele["parentid"] = dept.ParentID