给三方IM添加源官方地址链接 (#42)
This commit is contained in:
parent
7deb1ce0e8
commit
91194b04a9
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue