dingtalk

package module
v2.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 35 Imported by: 4

README

dingtalk

License ci codecov GitHub commit activity (branch) issues GitHub milestone tag

创建和配置应用 先有应用我们才能一起玩

dingtalk 是基于新版的 钉钉开发平台api文档 开发,也就是说在你使用之前是需要在钉钉开发者后台 创建一个小程序或应用

为什么有它

首先我要感谢 godingtalk 库,我是参考他的代码写的。但是由于钉钉历史原因,很多api都更新了,其次就是我有很多钉钉预警的业务需要做,于是就写了这个

怎么使用

go get github.com/zhaoyunxing92/dingtalk/v2
client := NewClient("appkey", "AppSecret")
// 获取token
token, _ := client.GetAccessToken()

fmt.Println(token)

日志级别设置

client:= NewClient(1244553273, "appkey", "AppSecret", WithLevel(zap.DebugLevel))

isv和企业内部开发切换

NewClient的时候如果调用了WithTicketWithCorpId则判定为是isv

怎么参与

正如你所见钉钉的文档太多了,欢迎大家来提交pr,怎么提交pr

参考文档

dingtalk-callback-Crypto

开发进度

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DingTalk added in v2.0.5

type DingTalk struct {

	// 日志级别
	Level zapcore.Level
	// contains filtered or unexported fields
}

func NewClient

func NewClient(key, secret string, opts ...OptionFunc) (ding *DingTalk, err error)

NewClient new client

func (*DingTalk) ActivateSuite added in v2.0.5

func (ding *DingTalk) ActivateSuite(corpId, code string) (rsp response.CorpAuthInfo, err error)

ActivateSuite 激活应用

func (*DingTalk) AddDriveSpacesFilesPermissions added in v2.0.5

func (ding *DingTalk) AddDriveSpacesFilesPermissions(res *request.AddDriveSpacesFilesPermissions) (rsp response.DriveSpacesFilesPermissions,
	err error,
)

AddDriveSpacesFilesPermissions 添加权限

func (*DingTalk) BatchAddUserRole added in v2.0.5

func (ding *DingTalk) BatchAddUserRole(rs []int, us []string) (apps response.Response, err error)

BatchAddUserRole 批量增加员工角色

func (*DingTalk) BatchRemoveUserRole added in v2.0.5

func (ding *DingTalk) BatchRemoveUserRole(roleIds []int, userIds []string) (apps response.Response, err error)

BatchRemoveUserRole 批量删除员工角色

func (*DingTalk) ChatFriendSwitch added in v2.0.5

func (ding *DingTalk) ChatFriendSwitch(chatId string, prohibit bool) (req response.Response, err error)

ChatFriendSwitch 设置禁止群成员私聊

func (*DingTalk) ChatSetSubAdmin added in v2.0.5

func (ding *DingTalk) ChatSetSubAdmin(chatId, userId string, role int) (req response.Response, err error)

ChatSetSubAdmin 设置群管理员

func (*DingTalk) ChatSetUserNick added in v2.0.5

func (ding *DingTalk) ChatSetUserNick(chatId, userId, nick string) (req response.Response, err error)

ChatSetUserNick 设置群成员昵称

func (*DingTalk) CreateAttendanceGroup added in v2.0.5

func (ding *DingTalk) CreateAttendanceGroup(res *request.CreateAttendanceGroup) (rsp response.CreateAttendanceGroup, err error)

CreateAttendanceGroup 创建考勤组

func (*DingTalk) CreateChat added in v2.0.5

func (ding *DingTalk) CreateChat(res *request.CreatChat) (rsp response.CreatChat, err error)

CreateChat 创建群

func (*DingTalk) CreateCooperateCorp added in v2.0.5

func (ding *DingTalk) CreateCooperateCorp(req *request.CreateCooperateCorp) (rsp response.CreateCooperateCorp,
	err error,
)

CreateCooperateCorp 创建合作空间

func (*DingTalk) CreateDept added in v2.0.5

func (ding *DingTalk) CreateDept(res *request.CreateDept) (rsp response.CreateDept, err error)

CreateDept 创建部门

func (*DingTalk) CreateDriveSpaces added in v2.0.5

func (ding *DingTalk) CreateDriveSpaces(name, unionId string) (rsp response.CreateDriveSpaces, err error)

CreateDriveSpaces 新建空间

func (*DingTalk) CreateDriveSpacesFiles added in v2.0.5

func (ding *DingTalk) CreateDriveSpacesFiles(res *request.CreateDriveSpacesFiles) (rsp response.GetDriveSpacesFileInfo,
	err error,
)

CreateDriveSpacesFiles 添加文件(夹)

func (*DingTalk) CreateExtContact added in v2.0.5

func (ding *DingTalk) CreateExtContact(res *request.CreateExtContact) (rsp response.CreateExtContact, err error)

CreateExtContact 添加外部联系人

func (*DingTalk) CreateRole added in v2.0.5

func (ding *DingTalk) CreateRole(name string, groupId int) (apps response.CreateRole, err error)

CreateRole 创建角色

func (*DingTalk) CreateRoleGroup added in v2.0.5

func (ding *DingTalk) CreateRoleGroup(name string) (apps response.CreateRoleGroup, err error)

CreateRoleGroup 创建角色组

func (*DingTalk) CreateTodo added in v2.0.5

func (ding *DingTalk) CreateTodo(res *request.CreateTodo) (req response.CreateTodo, err error)

CreateTodo 新增钉钉待办任务

func (*DingTalk) CreateUser added in v2.0.5

func (ding *DingTalk) CreateUser(user *request.CreateUser) (req response.CreateUser, err error)

CreateUser 创建用户

func (*DingTalk) DeleteDept added in v2.0.5

func (ding *DingTalk) DeleteDept(deptId int) (rsp response.Response, err error)

DeleteDept 删除部门

func (*DingTalk) DeleteDriveSpaces added in v2.0.5

func (ding *DingTalk) DeleteDriveSpaces(spaceId, unionId string) (rsp response.Response, err error)

DeleteDriveSpaces 删除空间

func (*DingTalk) DeleteDriveSpacesFiles added in v2.0.5

func (ding *DingTalk) DeleteDriveSpacesFiles(spaceId, fileId, unionId string,
	policy policy.DeletePolicy) (rsp response.Response, err error,
)

DeleteDriveSpacesFiles 删除文件(夹)

func (*DingTalk) DeleteExtContact added in v2.0.5

func (ding *DingTalk) DeleteExtContact(userId string) (rsp response.Response, err error)

DeleteExtContact 删除外部联系人

func (*DingTalk) DeleteRegisterEvent added in v2.0.6

func (ding *DingTalk) DeleteRegisterEvent() (res response.Response, err error)

DeleteRegisterEvent 删除事件回调接口

func (*DingTalk) DeleteRole added in v2.0.5

func (ding *DingTalk) DeleteRole(id int) (apps response.Response, err error)

DeleteRole 删除角色

func (*DingTalk) DeleteTodo added in v2.0.5

func (ding *DingTalk) DeleteTodo(unionId, taskId string) (req response.DeleteTodo, err error)

DeleteTodo 删除钉钉待办任务

func (*DingTalk) DeleteUser added in v2.0.5

func (ding *DingTalk) DeleteUser(userId string) (req response.Response, err error)

DeleteUser 删除用户

func (*DingTalk) FetchDeptList added in v2.0.5

func (ding *DingTalk) FetchDeptList(deptId int, fetch bool, lang language.Language) (rsp response.FetchDeptList, err error)

FetchDeptList 支持递归获取部门列表 https://open.dingtalk.com/document/orgapp-server/obtain-the-department-list

func (*DingTalk) GetAccessToken added in v2.0.5

func (ding *DingTalk) GetAccessToken() (token string, err error)

GetAccessToken 获取token

func (*DingTalk) GetAgentInfo added in v2.0.5

func (ding *DingTalk) GetAgentInfo(agentId int, corpId string) (rsp response.AgentInfo, err error)

GetAgentInfo 获取授权应用的基本信息

func (*DingTalk) GetAttendanceGroupDetail added in v2.0.5

func (ding *DingTalk) GetAttendanceGroupDetail(userId string, groupId int) (rsp response.GetAttendanceGroupDetail,
	err error)

GetAttendanceGroupDetail 获取考勤组详情

func (*DingTalk) GetAttendanceGroupMinimalism added in v2.0.5

func (ding *DingTalk) GetAttendanceGroupMinimalism(userId string, cursor int) (rsp response.GetAttendanceGroupMinimalism,
	err error)

GetAttendanceGroupMinimalism 批量获取考勤组摘要

func (*DingTalk) GetAttendanceGroups added in v2.0.5

func (ding *DingTalk) GetAttendanceGroups(offset, size int) (rsp response.GetAttendanceGroup, err error)

GetAttendanceGroups 批量获取考勤组详情

func (*DingTalk) GetAttendanceUserGroup added in v2.0.5

func (ding *DingTalk) GetAttendanceUserGroup(userId string) (rsp response.GetAttendanceUserGroup, err error)

GetAttendanceUserGroup 获取用户考勤组

func (*DingTalk) GetAuthInfo added in v2.0.5

func (ding *DingTalk) GetAuthInfo(corpId string) (rsp response.CorpAuthInfo, err error)

GetAuthInfo 获取企业授权信息

func (*DingTalk) GetChatInfo added in v2.0.5

func (ding *DingTalk) GetChatInfo(chatId string) (req response.GetChatInfo, err error)

GetChatInfo 获取群会话信息

func (*DingTalk) GetChatMsgReadUser added in v2.0.5

func (ding *DingTalk) GetChatMsgReadUser(messageId string, cursor, size int) (req response.ChatMsgReadUser, err error)

GetChatMsgReadUser 查询群消息已读人员列表

func (*DingTalk) GetChatQRCode added in v2.0.5

func (ding *DingTalk) GetChatQRCode(chatId, userId string) (req response.ChatQRCode, err error)

GetChatQRCode 获取入群二维码链接

func (*DingTalk) GetContactUser added in v2.1.1

func (ding *DingTalk) GetContactUser(unionId string) (rsp response.ContactUser, err error)

GetContactUser 获取用户通讯录个人信息 调用本接口获取企业用户通讯录中的个人信息。 @see https://open.dingtalk.com/document/orgapp/dingtalk-retrieve-user-information?spm=ding_open_doc.document.0.0.58b9492dZxH66f

func (*DingTalk) GetCorpAccessToken added in v2.0.5

func (ding *DingTalk) GetCorpAccessToken() (token string, err error)

GetCorpAccessToken 服务商获取第三方应用授权企业的access_token

func (*DingTalk) GetCorpConvMsgProgress added in v2.0.5

func (ding *DingTalk) GetCorpConvMsgProgress(agentId, taskId int) (rsp response.MessageProgress, err error)

GetCorpConvMsgProgress 获取工作通知消息的发送进度

func (*DingTalk) GetCorpDingIndex added in v2.0.5

func (ding *DingTalk) GetCorpDingIndex() (req response.CorpDingIndex, err error)

GetCorpDingIndex 获取企业最新钉钉指数信息

func (*DingTalk) GetCorpPermanentCode added in v2.0.5

func (ding *DingTalk) GetCorpPermanentCode(code string) (rsp response.CorpPermanentCode, err error)

GetCorpPermanentCode 获取授权企业的永久授权码

func (*DingTalk) GetCurrentUserByAccessToken added in v2.1.1

func (ding *DingTalk) GetCurrentUserByAccessToken(userAccessToken string) (rsp response.ContactUser, err error)

GetCurrentUserByAccessToken 通UserAccessToken获取当前授权人的信息

func (*DingTalk) GetDeptDetail added in v2.0.5

func (ding *DingTalk) GetDeptDetail(res *request.DeptDetail) (rsp response.DeptDetail, err error)

GetDeptDetail 获取部门详情

func (*DingTalk) GetDeptDetailUserInfo added in v2.0.5

func (ding *DingTalk) GetDeptDetailUserInfo(res *request.DeptDetailUserInfo) (req response.DeptDetailUserInfo,
	err error,
)

GetDeptDetailUserInfo 获取部门用户详情

func (*DingTalk) GetDeptList added in v2.0.5

func (ding *DingTalk) GetDeptList(res *request.DeptList) (rsp response.DeptList, err error)

GetDeptList 获取部门列表

func (*DingTalk) GetDeptSimpleUserInfo added in v2.0.5

func (ding *DingTalk) GetDeptSimpleUserInfo(res *request.DeptSimpleUserInfo) (req response.DeptSimpleUserInfo,
	err error,
)

GetDeptSimpleUserInfo 获取部门用户基础信息

func (*DingTalk) GetDeptUserIds added in v2.0.5

func (ding *DingTalk) GetDeptUserIds(du *request.DeptUserId) (req response.DeptUserId, err error)

GetDeptUserIds 获取部门用户userid列表

func (*DingTalk) GetDingTalkCrypto added in v2.0.5

func (ding *DingTalk) GetDingTalkCrypto(token, aesKey string) (*crypto.DingTalkCrypto, error)

GetDingTalkCrypto 钉钉事件解密类

func (*DingTalk) GetDriveSpaces added in v2.0.5

func (ding *DingTalk) GetDriveSpaces(unionId string, spaceType spaces.SpaceType, token string,
	size int) (rsp response.GetDriveSpaces, err error,
)

GetDriveSpaces 获取空间列表

func (*DingTalk) GetDriveSpacesFileInfo added in v2.0.5

func (ding *DingTalk) GetDriveSpacesFileInfo(spaceId, fileId, unionId string) (rsp response.GetDriveSpacesFileInfo,
	err error)

GetDriveSpacesFileInfo 查询文件(夹)信息

func (*DingTalk) GetDriveSpacesFiles added in v2.0.5

func (ding *DingTalk) GetDriveSpacesFiles(res *request.GetDriveSpacesFiles) (rsp response.GetDriveSpacesFiles,
	err error,
)

GetDriveSpacesFiles 查询文件(夹)列表 order 取值: createTimeAsc:按创建时间升序 createTimeDesc:按创建时间降序 modifyTimeAsc:按修改时间升序 modifyTimeDesc:按修改时间降序 nameAsc:按名称升序 nameDesc:按名称降序 sizeAsc:按大小升序 sizeDesc:按大小降序 默认值:createTimeDesc

func (*DingTalk) GetDriveSpacesFilesDownloadInfo added in v2.0.5

func (ding *DingTalk) GetDriveSpacesFilesDownloadInfo(spaceId, fileId,
	unionId string) (rsp response.GetDriveSpacesFileInfo, err error,
)

GetDriveSpacesFilesDownloadInfo 获取文件下载信息

func (*DingTalk) GetDriveSpacesFilesPermissions added in v2.0.5

func (ding *DingTalk) GetDriveSpacesFilesPermissions(spaceId, fileId, unionId string) (rsp response.DriveSpacesFilesPermissions,
	err error,
)

GetDriveSpacesFilesPermissions 获取权限列表

func (*DingTalk) GetDriveSpacesFilesUploadInfo added in v2.0.5

func (ding *DingTalk) GetDriveSpacesFilesUploadInfo(res *request.GetDriveSpacesFilesUploadInfo) (rsp response.GetDriveSpacesFileInfo, err error)

GetDriveSpacesFilesUploadInfo 获取文件上传信息

func (*DingTalk) GetDriveSpacesInfo added in v2.0.5

func (ding *DingTalk) GetDriveSpacesInfo(spaceId, unionId string) (rsp response.CreateDriveSpaces, err error)

GetDriveSpacesInfo 获取空间信息

func (*DingTalk) GetExtContact added in v2.0.5

func (ding *DingTalk) GetExtContact(offset, size int) (rsp response.GetExtContact, err error)

GetExtContact 获取外部联系人列表

func (*DingTalk) GetExtContactDetail added in v2.0.5

func (ding *DingTalk) GetExtContactDetail(userId string) (rsp response.GetExtContactDetail, err error)

GetExtContactDetail 获取外部联系人详情

func (*DingTalk) GetExtContactLabel added in v2.0.5

func (ding *DingTalk) GetExtContactLabel(offset, size int) (rsp response.GetExtContactLabel, err error)

GetExtContactLabel 获取外部联系人标签列表

func (*DingTalk) GetGroupRoles added in v2.0.5

func (ding *DingTalk) GetGroupRoles(groupId int) (apps response.GroupRole, err error)

GetGroupRoles 获取角色组列表

func (DingTalk) GetHrmEmpLeaveRecords added in v2.1.1

func (ding DingTalk) GetHrmEmpLeaveRecords(startTime string, endTime string, nextToken string, maxResults int) (res response.GetHrmEmployeeLevelRecord, err error)

GetHrmResignEmployeeIds 获取时间范围内离职员工记录

func (DingTalk) GetHrmEmployee added in v2.0.5

func (ding DingTalk) GetHrmEmployee(offset, size int, status []employee.Status) (res response.GetHrmEmployee,
	err error)

GetHrmEmployee 获取在职员工列表

func (DingTalk) GetHrmEmployeeField added in v2.0.5

func (ding DingTalk) GetHrmEmployeeField(agentId int, userIds []string, fields []string) (res response.GetHrmEmployeeField, err error)

GetHrmEmployeeField 获取员工花名册字段信息

func (DingTalk) GetHrmField added in v2.0.5

func (ding DingTalk) GetHrmField(agentId int) (res response.GetHrmField, err error)

GetHrmField 获取花名册字段组详情

func (DingTalk) GetHrmMeta added in v2.0.5

func (ding DingTalk) GetHrmMeta(agentId int) (res response.GetHrmMeta, err error)

GetHrmMeta 获取花名册元数据

func (DingTalk) GetHrmResignEmployee added in v2.0.5

func (ding DingTalk) GetHrmResignEmployee(userIds []string) (res response.HrmResignEmployee, err error)

GetHrmResignEmployee 获取员工离职信息

func (DingTalk) GetHrmResignEmployeeIds added in v2.0.5

func (ding DingTalk) GetHrmResignEmployeeIds(offset, size int) (res response.GetHrmEmployee, err error)

GetHrmResignEmployeeIds 获取离职员工列表

func (DingTalk) GetHrmToBeHiredEmployee added in v2.0.5

func (ding DingTalk) GetHrmToBeHiredEmployee(offset, size int) (res response.GetHrmEmployee,
	err error)

GetHrmToBeHiredEmployee 获取待入职员工列表

func (*DingTalk) GetInactiveUser added in v2.0.5

func (ding *DingTalk) GetInactiveUser(res *request.InactiveUser) (req response.InactiveUser, err error)

GetInactiveUser 获取未登录钉钉的员工列表

func (*DingTalk) GetIndustryDept added in v2.0.5

func (ding *DingTalk) GetIndustryDept(deptId, offset, size int) (rsp response.GetIndustryDept, err error)

GetIndustryDept 获取部门列表,行业根部门传1

func (*DingTalk) GetIndustryDeptDetail added in v2.0.5

func (ding *DingTalk) GetIndustryDeptDetail(deptId int) (rsp response.GetIndustryDeptDetail, err error)

GetIndustryDeptDetail 获取部门详情

func (*DingTalk) GetJsApiTicket added in v2.0.5

func (ding *DingTalk) GetJsApiTicket() (ticket string, err error)

GetJsApiTicket 获取jsapi_ticket

func (*DingTalk) GetMessageSendResult added in v2.0.5

func (ding *DingTalk) GetMessageSendResult(agentId, taskId int) (rsp response.MessageSendResult, err error)

GetMessageSendResult 获取工作通知消息的发送结果

func (*DingTalk) GetMicroAppByAgentId added in v2.0.5

func (ding *DingTalk) GetMicroAppByAgentId(agentId int) (domain.MicroApp, error)

GetMicroAppByAgentId 根据id获取应用

func (*DingTalk) GetMicroAppList added in v2.0.5

func (ding *DingTalk) GetMicroAppList() (rsp response.MicroAppList, err error)

GetMicroAppList 获取应用列表

func (*DingTalk) GetMicroAppVisibleScopes added in v2.0.5

func (ding *DingTalk) GetMicroAppVisibleScopes(agentId int) (scopes response.MicroAppVisibleScopes, err error)

GetMicroAppVisibleScopes 获取应用可见范围

func (*DingTalk) GetOrgAdminScope added in v2.0.5

func (ding *DingTalk) GetOrgAdminScope(res *request.AdminUserScope) (req response.AdminUserScope, err error)

GetOrgAdminScope 获取管理员通讯录权限范围

func (*DingTalk) GetOrgAdminUser added in v2.0.5

func (ding *DingTalk) GetOrgAdminUser() (req response.OrgAdminUser, err error)

GetOrgAdminUser 获取管理员列表

func (*DingTalk) GetParentIdsByDeptId added in v2.0.5

func (ding *DingTalk) GetParentIdsByDeptId(deptId int) (req response.GetParentIdsByDeptId, err error)

GetParentIdsByDeptId 获取指定部门的所有父部门列表

func (*DingTalk) GetParentIdsByUserId added in v2.0.5

func (ding *DingTalk) GetParentIdsByUserId(userId string) (req response.GetParentIdsByUserId, err error)

GetParentIdsByUserId 获取指定用户的所有父部门列表

func (*DingTalk) GetRegisterEvent added in v2.0.6

func (ding *DingTalk) GetRegisterEvent() (res response.RegisterEvent, err error)

GetRegisterEvent 查询订阅事件

func (*DingTalk) GetRegisterFailedEvent added in v2.0.6

func (ding *DingTalk) GetRegisterFailedEvent() (res response.FailedRegisterEvent, err error)

GetRegisterFailedEvent 获取推送失败的事件列表

func (*DingTalk) GetRoleDetail added in v2.0.5

func (ding *DingTalk) GetRoleDetail(roleId int) (apps response.RoleDetail, err error)

GetRoleDetail 获取角色详情

func (*DingTalk) GetRoleList added in v2.0.5

func (ding *DingTalk) GetRoleList(offset, size int) (apps response.RoleList, err error)

GetRoleList 获取角色列表

func (*DingTalk) GetRoleUserList added in v2.0.5

func (ding *DingTalk) GetRoleUserList(roleId, offset, size int) (apps response.RoleUser, err error)

GetRoleUserList 获取指定角色的员工列表

func (*DingTalk) GetSSOToken added in v2.0.5

func (ding *DingTalk) GetSSOToken(corpId, secret string) (token string, err error)

GetSSOToken 获取微应用后台免登的access_token

func (*DingTalk) GetSSOUserInfo added in v2.0.5

func (ding *DingTalk) GetSSOUserInfo(code string) (req response.SSOUserInfo, err error)

GetSSOUserInfo 获取应用管理员的身份信息

func (*DingTalk) GetSnsUserInfo added in v2.0.5

func (ding *DingTalk) GetSnsUserInfo(code string) (req response.SnsUserInfo, err error)

GetSnsUserInfo 根据sns临时授权码获取用户信息 该接口获取的用户信息仅用于扫码登录第三方网站、钉钉内免登第三方网站和使用钉钉账号登录第三方网站的场景。

func (*DingTalk) GetSubDeptList added in v2.0.5

func (ding *DingTalk) GetSubDeptList(deptId int) (rsp response.SubDeptList, err error)

GetSubDeptList 获取子部门列表

func (*DingTalk) GetSuiteAccessToken added in v2.0.5

func (ding *DingTalk) GetSuiteAccessToken() (token string, err error)

GetSuiteAccessToken 获取第三方企业应用的suite_access_token

func (*DingTalk) GetTodoDetail added in v2.0.5

func (ding *DingTalk) GetTodoDetail(unionId, taskId string) (req response.GetTodoDetail, err error)

GetTodoDetail 获取钉钉待办任务详情

func (*DingTalk) GetTodoList added in v2.0.5

func (ding *DingTalk) GetTodoList(unionId, token string, done bool) (req response.GetTodoList, err error)

GetTodoList 查询企业下用户待办列表

func (*DingTalk) GetTodoListBySourceId added in v2.0.5

func (ding *DingTalk) GetTodoListBySourceId(unionId, sourceId string) (req response.GetTodoDetail, err error)

GetTodoListBySourceId 根据sourceId获取钉钉待办任务详情

func (*DingTalk) GetUnactiveCorp added in v2.0.5

func (ding *DingTalk) GetUnactiveCorp(appId int) (rsp response.UnactiveCorp, err error)

GetUnactiveCorp 获取应用未激活的企业列表

func (*DingTalk) GetUserAccessToken added in v2.1.1

func (ding *DingTalk) GetUserAccessToken(authCode string) (res response.UserAccessToken, err error)

GetUserAccessToken 通过oauth2临时授权码获取用户Token https://open.dingtalk.com/document/orgapp/obtain-user-token

func (*DingTalk) GetUserCanAccessApplet added in v2.0.5

func (ding *DingTalk) GetUserCanAccessApplet(appId int, userId string) (req response.UserCanAccessApplet, err error)

GetUserCanAccessApplet 获取管理员的应用管理权限

func (*DingTalk) GetUserCount added in v2.0.5

func (ding *DingTalk) GetUserCount(res *request.UserCount) (req response.UserCont, err error)

GetUserCount 获取员工人数

func (*DingTalk) GetUserDetail added in v2.0.5

func (ding *DingTalk) GetUserDetail(user *request.UserDetail) (req response.UserDetail, err error)

GetUserDetail 根据userid获取用户详情

func (*DingTalk) GetUserIdByMobile added in v2.0.5

func (ding *DingTalk) GetUserIdByMobile(res *request.MobileGetUserId) (req response.MobileGetUserId, err error)

GetUserIdByMobile 根据手机号获取userid

func (*DingTalk) GetUserIdByUnionId added in v2.0.5

func (ding *DingTalk) GetUserIdByUnionId(res *request.UnionIdGetUserId) (req response.UnionIdGetUserId, err error)

GetUserIdByUnionId 根据unionid获取用户userid

func (*DingTalk) GetUserInfoByCode added in v2.0.5

func (ding *DingTalk) GetUserInfoByCode(code string) (req response.CodeGetUserInfo, err error)

GetUserInfoByCode 通过免登码获取用户信息

func (*DingTalk) GetUserMicroAppVisibleScopes added in v2.0.6

func (ding *DingTalk) GetUserMicroAppVisibleScopes(userId string) (scopes response.MicroAppList, err error)

GetUserMicroAppVisibleScopes 获取员工可见的应用列表

func (DingTalk) HrmCreateEmployee added in v2.0.5

func (ding DingTalk) HrmCreateEmployee(req *request.HrmCreateEmployee) (res response.HrmCreateEmployee, err error)

HrmCreateEmployee 添加企业待入职员工

func (*DingTalk) MediaUpload added in v2.0.5

func (ding *DingTalk) MediaUpload(req request.UploadFile) (media response.MediaUpload, err error)

MediaUpload 上传媒体文件

func (*DingTalk) MoveDriveSpacesFiles added in v2.0.5

func (ding *DingTalk) MoveDriveSpacesFiles(res *request.MoveDriveSpacesFiles) (rsp response.GetDriveSpacesFileInfo,
	err error,
)

MoveDriveSpacesFiles 移动文件(夹)

func (*DingTalk) OcrRecognize added in v2.0.5

func (ding *DingTalk) OcrRecognize(ocrType, imageUrl string) (rsp domain.OcrStructuredResponse, err error)

OcrRecognize:OCR文字识别 ocrType:识别类型 imageUrl:图片url

func (*DingTalk) ReauthCorp added in v2.0.5

func (ding *DingTalk) ReauthCorp(appId int, corpId string, corpIds ...string) (rsp response.Response, err error)

ReauthCorp 重新授权未激活应用的企业

func (*DingTalk) RecallCorpConvMessage added in v2.0.5

func (ding *DingTalk) RecallCorpConvMessage(agentId, taskId int) (rsp response.Response, err error)

RecallCorpConvMessage 撤回工作通知消息

func (*DingTalk) RegisterEvent added in v2.0.6

func (ding *DingTalk) RegisterEvent(req *request.RegisterEvent) (res response.Response, err error)

RegisterEvent 注册事件

func (*DingTalk) RenameDriveSpacesFiles added in v2.0.5

func (ding *DingTalk) RenameDriveSpacesFiles(spaceId, fileId, newFileName,
	unionId string) (rsp response.GetDriveSpacesFileInfo, err error,
)

RenameDriveSpacesFiles 修改文件(夹)名

func (*DingTalk) Request added in v2.0.5

func (ding *DingTalk) Request(method, path string, query url.Values, body interface{},
	data response.Unmarshalled) (err error)

Request 统一请求

func (*DingTalk) SearchAttendanceGroup added in v2.0.5

func (ding *DingTalk) SearchAttendanceGroup(userId, groupName string) (rsp response.SearchAttendanceGroup, err error)

SearchAttendanceGroup 搜索考勤组摘要

func (*DingTalk) SendChatMessage added in v2.0.5

func (ding *DingTalk) SendChatMessage(chatId string, msg message.Message) (req response.SendChatMessage, err error)

SendChatMessage 发送消息到群

func (*DingTalk) SendCorpConvMessage added in v2.0.5

func (ding *DingTalk) SendCorpConvMessage(req *request.CorpConvMessage) (rsp response.CorpConvMessage,
	err error)

SendCorpConvMessage 发送工作通知

func (*DingTalk) SendMessage added in v2.0.5

func (ding *DingTalk) SendMessage(senderId, chatId string, msg message.Message) (req response.SendMessage, err error)

SendMessage 发送普通消息

func (*DingTalk) SendTemplateMessage added in v2.0.5

func (ding *DingTalk) SendTemplateMessage(req *request.SendTemplateMessage) (rsp response.SendTemplateMessage,
	err error)

SendTemplateMessage 使用模板发送工作通知消息

func (*DingTalk) SetUserRoleManageScope added in v2.0.5

func (ding *DingTalk) SetUserRoleManageScope(res *request.SetUserRoleManageScope) (apps response.Response, err error)

SetUserRoleManageScope 设定角色成员管理范围 todo:官方接口不通

func (*DingTalk) Translate added in v2.0.5

func (ding *DingTalk) Translate(query, sourceLanguage, targetLanguage string) (rsp domain.AiResponse, err error)

Translate:文本翻译

func (*DingTalk) UpdateChat added in v2.0.5

func (ding *DingTalk) UpdateChat(res *request.UpdateChat) (req response.Response, err error)

UpdateChat 修改群会话

func (*DingTalk) UpdateCorpConvMessageStatus added in v2.0.5

func (ding *DingTalk) UpdateCorpConvMessageStatus(req *request.UpdateCorpConvMsgStatus) (rsp response.Response,
	err error)

UpdateCorpConvMessageStatus 更新工作通知状态栏

func (*DingTalk) UpdateDept added in v2.0.5

func (ding *DingTalk) UpdateDept(res *request.UpdateDept) (rsp response.Response, err error)

UpdateDept 更新部门

func (*DingTalk) UpdateExtContact added in v2.0.5

func (ding *DingTalk) UpdateExtContact(res *request.UpdateExtContact) (rsp response.CreateExtContact, err error)

UpdateExtContact 更新外部联系人

func (DingTalk) UpdateHrmEmployeeField added in v2.0.5

func (ding DingTalk) UpdateHrmEmployeeField(req *request.UpdateHrmEmpField) (res response.Response, err error)

UpdateHrmEmployeeField 更新员工花名册信息

func (*DingTalk) UpdateRegisterEvent added in v2.0.6

func (ding *DingTalk) UpdateRegisterEvent(req *request.RegisterEvent) (res response.Response, err error)

UpdateRegisterEvent 更新事件接口

func (*DingTalk) UpdateRole added in v2.0.5

func (ding *DingTalk) UpdateRole(id int, name string) (apps response.Response, err error)

UpdateRole 更新角色

func (*DingTalk) UpdateTodo added in v2.0.5

func (ding *DingTalk) UpdateTodo(res *request.UpdateTodo) (req response.UpdateTodo, err error)

UpdateTodo 更新钉钉待办任务

func (*DingTalk) UpdateTodoDone added in v2.0.5

func (ding *DingTalk) UpdateTodoDone(res *request.UpdateTodoDone) (req response.UpdateTodo, err error)

UpdateTodoDone 更新钉钉待办执行者状态

func (*DingTalk) UpdateUser added in v2.0.5

func (ding *DingTalk) UpdateUser(user *request.UpdateUser) (req response.Response, err error)

UpdateUser 更新用户信息

func (*DingTalk) VoiceTranslate added in v2.0.5

func (ding *DingTalk) VoiceTranslate(mediaId string) (rsp domain.AiResponse, err error)

VoiceTranslate:ASR 一句话语音识别 mediaId:音频id

type OptionFunc

type OptionFunc func(*DingTalk)

func WithCache added in v2.1.1

func WithCache(cache cache.Cache) OptionFunc

func WithCorpId

func WithCorpId(corpId string) OptionFunc

func WithLevel added in v2.0.2

func WithLevel(level zapcore.Level) OptionFunc

func WithSSOSecret added in v2.0.2

func WithSSOSecret(secret string) OptionFunc

func WithTicket

func WithTicket(ticket string) OptionFunc

type Robot

type Robot struct {
	Token string
	// contains filtered or unexported fields
}

func (*Robot) SendRobotMsg

func (robot *Robot) SendRobotMsg(req domain.Request) (res domain.Response, err error)

SendRobotMsg:机器人发送消息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL