dingtalk

package module
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

README

dingtalk

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

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

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

为什么有它

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

怎么使用

go get github.com/go-packages/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

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

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

ActivateSuite 激活应用

func (*DingTalk) AddDriveSpacesFilesPermissions

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

AddDriveSpacesFilesPermissions 添加权限

func (*DingTalk) BatchAddUserRole

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

BatchAddUserRole 批量增加员工角色

func (*DingTalk) BatchRemoveUserRole

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

BatchRemoveUserRole 批量删除员工角色

func (*DingTalk) ChatFriendSwitch

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

ChatFriendSwitch 设置禁止群成员私聊

func (*DingTalk) ChatSetSubAdmin

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

ChatSetSubAdmin 设置群管理员

func (*DingTalk) ChatSetUserNick

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

ChatSetUserNick 设置群成员昵称

func (*DingTalk) CreateAttendanceGroup

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

CreateAttendanceGroup 创建考勤组

func (*DingTalk) CreateChat

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

CreateChat 创建群

func (*DingTalk) CreateCooperateCorp

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

CreateCooperateCorp 创建合作空间

func (*DingTalk) CreateDept

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

CreateDept 创建部门

func (*DingTalk) CreateDriveSpaces

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

CreateDriveSpaces 新建空间

func (*DingTalk) CreateDriveSpacesFiles

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

CreateDriveSpacesFiles 添加文件(夹)

func (*DingTalk) CreateExtContact

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

CreateExtContact 添加外部联系人

func (*DingTalk) CreateRole

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

CreateRole 创建角色

func (*DingTalk) CreateRoleGroup

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

CreateRoleGroup 创建角色组

func (*DingTalk) CreateTodo

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

CreateTodo 新增钉钉待办任务

func (*DingTalk) CreateUser

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

CreateUser 创建用户

func (*DingTalk) DeleteDept

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

DeleteDept 删除部门

func (*DingTalk) DeleteDriveSpaces

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

DeleteDriveSpaces 删除空间

func (*DingTalk) DeleteDriveSpacesFiles

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

DeleteDriveSpacesFiles 删除文件(夹)

func (*DingTalk) DeleteExtContact

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

DeleteExtContact 删除外部联系人

func (*DingTalk) DeleteRegisterEvent

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

DeleteRegisterEvent 删除事件回调接口

func (*DingTalk) DeleteRole

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

DeleteRole 删除角色

func (*DingTalk) DeleteTodo

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

DeleteTodo 删除钉钉待办任务

func (*DingTalk) DeleteUser

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

DeleteUser 删除用户

func (*DingTalk) FetchDeptList

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

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

GetAccessToken 获取token

func (*DingTalk) GetAgentInfo

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

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

func (*DingTalk) GetAttendanceGroupDetail

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

GetAttendanceGroupDetail 获取考勤组详情

func (*DingTalk) GetAttendanceGroupMinimalism

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

GetAttendanceGroupMinimalism 批量获取考勤组摘要

func (*DingTalk) GetAttendanceGroups

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

GetAttendanceGroups 批量获取考勤组详情

func (*DingTalk) GetAttendanceUserGroup

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

GetAttendanceUserGroup 获取用户考勤组

func (*DingTalk) GetAuthInfo

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

GetAuthInfo 获取企业授权信息

func (*DingTalk) GetChatInfo

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

GetChatInfo 获取群会话信息

func (*DingTalk) GetChatMsgReadUser

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

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

func (*DingTalk) GetChatQRCode

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

GetChatQRCode 获取入群二维码链接

func (*DingTalk) GetCorpAccessToken

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

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

func (*DingTalk) GetCorpConvMsgProgress

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

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

func (*DingTalk) GetCorpDingIndex

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

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

func (*DingTalk) GetCorpPermanentCode

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

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

func (*DingTalk) GetDeptDetail

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

GetDeptDetail 获取部门详情

func (*DingTalk) GetDeptDetailUserInfo

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

GetDeptDetailUserInfo 获取部门用户详情

func (*DingTalk) GetDeptList

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

GetDeptList 获取部门列表

func (*DingTalk) GetDeptSimpleUserInfo

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

GetDeptSimpleUserInfo 获取部门用户基础信息

func (*DingTalk) GetDeptUserIds

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

GetDeptUserIds 获取部门用户userid列表

func (*DingTalk) GetDingTalkCrypto

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

GetDingTalkCrypto 钉钉事件解密类

func (*DingTalk) GetDriveSpaces

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

GetDriveSpaces 获取空间列表

func (*DingTalk) GetDriveSpacesFileInfo

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

GetDriveSpacesFileInfo 查询文件(夹)信息

func (*DingTalk) GetDriveSpacesFiles

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

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

GetDriveSpacesFilesDownloadInfo 获取文件下载信息

func (*DingTalk) GetDriveSpacesFilesPermissions

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

GetDriveSpacesFilesPermissions 获取权限列表

func (*DingTalk) GetDriveSpacesFilesUploadInfo

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

GetDriveSpacesFilesUploadInfo 获取文件上传信息

func (*DingTalk) GetDriveSpacesInfo

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

GetDriveSpacesInfo 获取空间信息

func (*DingTalk) GetExtContact

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

GetExtContact 获取外部联系人列表

func (*DingTalk) GetExtContactDetail

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

GetExtContactDetail 获取外部联系人详情

func (*DingTalk) GetExtContactLabel

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

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

func (*DingTalk) GetGroupRoles

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

GetGroupRoles 获取角色组列表

func (DingTalk) GetHrmEmployee

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

GetHrmEmployee 获取在职员工列表

func (DingTalk) GetHrmEmployeeField

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

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

func (DingTalk) GetHrmField

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

GetHrmField 获取花名册字段组详情

func (DingTalk) GetHrmMeta

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

GetHrmMeta 获取花名册元数据

func (DingTalk) GetHrmResignEmployee

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

GetHrmResignEmployee 获取员工离职信息

func (DingTalk) GetHrmResignEmployeeIds

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

GetHrmResignEmployeeIds 获取离职员工列表

func (DingTalk) GetHrmToBeHiredEmployee

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

GetHrmToBeHiredEmployee 获取待入职员工列表

func (*DingTalk) GetInactiveUser

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

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

func (*DingTalk) GetIndustryDept

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

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

func (*DingTalk) GetIndustryDeptDetail

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

GetIndustryDeptDetail 获取部门详情

func (*DingTalk) GetJsApiTicket

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

GetJsApiTicket 获取jsapi_ticket

func (*DingTalk) GetMessageSendResult

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

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

func (*DingTalk) GetMicroAppByAgentId

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

GetMicroAppByAgentId 根据id获取应用

func (*DingTalk) GetMicroAppList

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

GetMicroAppList 获取应用列表

func (*DingTalk) GetMicroAppVisibleScopes

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

GetMicroAppVisibleScopes 获取应用可见范围

func (*DingTalk) GetOrgAdminScope

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

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

func (*DingTalk) GetOrgAdminUser

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

GetOrgAdminUser 获取管理员列表

func (*DingTalk) GetParentIdsByDeptId

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

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

func (*DingTalk) GetParentIdsByUserId

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

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

func (*DingTalk) GetRegisterEvent

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

GetRegisterEvent 查询订阅事件

func (*DingTalk) GetRegisterFailedEvent

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

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

func (*DingTalk) GetRoleDetail

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

GetRoleDetail 获取角色详情

func (*DingTalk) GetRoleList

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

GetRoleList 获取角色列表

func (*DingTalk) GetRoleUserList

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

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

func (*DingTalk) GetSSOToken

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

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

func (*DingTalk) GetSSOUserInfo

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

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

func (*DingTalk) GetSnsUserInfo

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

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

func (*DingTalk) GetSubDeptList

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

GetSubDeptList 获取子部门列表

func (*DingTalk) GetSuiteAccessToken

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

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

func (*DingTalk) GetTodoDetail

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

GetTodoDetail 获取钉钉待办任务详情

func (*DingTalk) GetTodoList

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

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

func (*DingTalk) GetTodoListBySourceId

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

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

func (*DingTalk) GetUnactiveCorp

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

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

func (*DingTalk) GetUserAccessToken added in v2.3.0

func (ding *DingTalk) GetUserAccessToken(grantType string, authCode string, refreshToken string) (req response.GetUserAccessToken, err error)

GetUserAccessToken 获取用户token

func (*DingTalk) GetUserCanAccessApplet

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

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

func (*DingTalk) GetUserCount

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

GetUserCount 获取员工人数

func (*DingTalk) GetUserDetail

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

GetUserDetail 根据userid获取用户详情

func (*DingTalk) GetUserIdByMobile

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

GetUserIdByMobile 根据手机号获取userid

func (*DingTalk) GetUserIdByUnionId

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

GetUserIdByUnionId 根据unionid获取用户userid

func (*DingTalk) GetUserInfoByCode

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

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

func (*DingTalk) GetUserInfoByUnionId added in v2.3.0

func (ding *DingTalk) GetUserInfoByUnionId(userAccessToken string, unionId string) (rsp response.GetUserInfoByUnionId, err error)

GetUserInfoByUnionId 获取用户通讯录个人信息

func (*DingTalk) GetUserMicroAppVisibleScopes

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

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

func (DingTalk) HrmCreateEmployee

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

HrmCreateEmployee 添加企业待入职员工

func (*DingTalk) MediaUpload

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

MediaUpload 上传媒体文件

func (*DingTalk) MoveDriveSpacesFiles

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

MoveDriveSpacesFiles 移动文件(夹)

func (*DingTalk) OcrRecognize

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

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

func (*DingTalk) ReauthCorp

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

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

func (*DingTalk) RecallCorpConvMessage

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

RecallCorpConvMessage 撤回工作通知消息

func (*DingTalk) RegisterEvent

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

RegisterEvent 注册事件

func (*DingTalk) RenameDriveSpacesFiles

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

RenameDriveSpacesFiles 修改文件(夹)名

func (*DingTalk) Request

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

Request 统一请求

func (*DingTalk) SearchAttendanceGroup

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

SearchAttendanceGroup 搜索考勤组摘要

func (*DingTalk) SendChatMessage

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

SendChatMessage 发送消息到群

func (*DingTalk) SendCorpConvMessage

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

SendCorpConvMessage 发送工作通知

func (*DingTalk) SendMessage

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

SendMessage 发送普通消息

func (*DingTalk) SendTemplateMessage

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

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

func (*DingTalk) SetUserRoleManageScope

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

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

func (*DingTalk) Translate

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

Translate:文本翻译

func (*DingTalk) UpdateChat

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

UpdateChat 修改群会话

func (*DingTalk) UpdateCorpConvMessageStatus

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

UpdateCorpConvMessageStatus 更新工作通知状态栏

func (*DingTalk) UpdateDept

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

UpdateDept 更新部门

func (*DingTalk) UpdateExtContact

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

UpdateExtContact 更新外部联系人

func (DingTalk) UpdateHrmEmployeeField

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

UpdateHrmEmployeeField 更新员工花名册信息

func (*DingTalk) UpdateRegisterEvent

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

UpdateRegisterEvent 更新事件接口

func (*DingTalk) UpdateRole

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

UpdateRole 更新角色

func (*DingTalk) UpdateTodo

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

UpdateTodo 更新钉钉待办任务

func (*DingTalk) UpdateTodoDone

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

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

func (*DingTalk) UpdateUser

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

UpdateUser 更新用户信息

func (*DingTalk) VoiceTranslate

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

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

type OptionFunc

type OptionFunc func(*DingTalk)

func WithCorpId

func WithCorpId(corpId string) OptionFunc

func WithLevel

func WithLevel(level zapcore.Level) OptionFunc

func WithSSOSecret

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