diff --git a/config.yml b/config.yml index 06c3d42..f3cd07b 100644 --- a/config.yml +++ b/config.yml @@ -114,6 +114,7 @@ wecom: corp-secret: "xxxxx" # 企业微信中创建的应用secret enable-sync: false # 是否开启定时同步企业微信的任务 feishu: + # 配置获取详细文档参考:http://ldapdoc.eryajf.net/pages/83c90b/ flag: "feishu" # 作为飞书在平台的标识 app-id: "xxxxxxx" # 飞书的app-id app-secret: "xxxxxxxxxxx" # 飞书的app-secret \ No newline at end of file diff --git a/public/client/dingtalk/dingtalk.go b/public/client/dingtalk/dingtalk.go index 9cb033d..de14ef7 100644 --- a/public/client/dingtalk/dingtalk.go +++ b/public/client/dingtalk/dingtalk.go @@ -7,6 +7,8 @@ import ( "github.com/zhaoyunxing92/dingtalk/v2/request" ) +// 官方文档地址: https://open.dingtalk.com/document/orgapp-server/obtain-the-department-list +// GetAllDepts 获取所有部门 func GetAllDepts(deptId int) (result []*DingTalkDept, err error) { depts, err := InitDingTalkClient().FetchDeptList(deptId, true, "zh_CN") if err != nil { @@ -24,6 +26,8 @@ func GetAllDepts(deptId int) (result []*DingTalkDept, err error) { return } +// 官方文档地址: https://open.dingtalk.com/document/orgapp-server/queries-the-complete-information-of-a-department-user +// GetAllUsers 获取所有员工信息 func GetAllUsers() (result []*DingTalkUser, err error) { depts, err := GetAllDepts(1) if err != nil { @@ -82,6 +86,7 @@ func GetAllUsers() (result []*DingTalkUser, err error) { return } +// 官方文档:https://open.dingtalk.com/document/orgapp-server/intelligent-personnel-query-company-turnover-list // GetLeaveUserIds 获取离职人员ID列表 func GetLeaveUserIds() ([]string, error) { var ids []string diff --git a/public/client/feishu/feishu.go b/public/client/feishu/feishu.go index 0ea745c..19f081f 100644 --- a/public/client/feishu/feishu.go +++ b/public/client/feishu/feishu.go @@ -6,6 +6,7 @@ import ( "github.com/chyroc/lark" ) +// 官方文档: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children // GetAllDepts 获取所有部门 func GetAllDepts() (depts []*lark.GetDepartmentListRespItem, err error) { var ( @@ -32,6 +33,7 @@ func GetAllDepts() (depts []*lark.GetDepartmentListRespItem, err error) { return } +// 官方文档: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department // GetAllUsers 获取所有员工信息 func GetAllUsers() (users []*lark.GetUserListRespItem, err error) { var ( @@ -62,6 +64,7 @@ func GetAllUsers() (users []*lark.GetUserListRespItem, err error) { return } +// 官方文档: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/employee/list // GetLeaveUserIds 获取离职人员ID列表 func GetLeaveUserIds() ([]string, error) { var ids []string diff --git a/public/client/wechat/wecom.go b/public/client/wechat/wecom.go index 8d5096a..dce6e73 100644 --- a/public/client/wechat/wecom.go +++ b/public/client/wechat/wecom.go @@ -6,6 +6,7 @@ import ( "github.com/wenerme/go-wecom/wecom" ) +// 官方文档: https://developer.work.weixin.qq.com/document/path/90208 // GetAllDepts 获取所有部门 func GetAllDepts() ([]wecom.ListDepartmentResponseItem, error) { depts, err := InitWeComClient().ListDepartment( @@ -17,6 +18,7 @@ func GetAllDepts() ([]wecom.ListDepartmentResponseItem, error) { return depts.Department, nil } +// 官方文档: https://developer.work.weixin.qq.com/document/path/90201 // GetAllUsers 获取所有员工信息 func GetAllUsers() ([]wecom.ListUserResponseItem, error) { depts, err := GetAllDepts()