sdk

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AES_ENCODE_KEY_LENGTH = 43
)

Variables

This section is empty.

Functions

func CalculateJsApiSign

func CalculateJsApiSign(ticket string, nonceStr string, timestamp int64, url string) string

func CorpAuth

func CorpAuth(url string, suiteKey string, suiteSecret string, suiteTicket string, authCorpId string, agentId int64) (string, error)

CorpAuth is the common signature methods for multiple authentication interfaces Get a common interface for enterprise authentication information

func Ddbase64sign

func Ddbase64sign(key string) (bt []byte, err error)

Base64解密

func ExcuteOapi

func ExcuteOapi(url string, oauthAppId string, oauthAppSecret string, body string) (string, error)

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

func PKCS7UnPadding

func PKCS7UnPadding(plantText []byte) []byte

func RobotSender

func RobotSender(webHook string, msg WorkNoticeMsg)

Types

type ActionCardBtnJsonList

type ActionCardBtnJsonList struct {
	Title     string `json:"title"`
	ActionUrl string `json:"action_url"`
}

type ActionCardNotice

type ActionCardNotice struct {
	Title          string                   `json:"title"`
	Markdown       string                   `json:"markdown"`
	SingleTitle    *string                  `json:"single_title"`
	SingleUrl      *string                  `json:"single_url"`
	BtnOrientation *int64                   `json:"btn_orientation"`
	BtnJsonList    *[]ActionCardBtnJsonList `json:"btn_json_list"`
}

type AddFileToUserCSpaceResp

type AddFileToUserCSpaceResp struct {
	BaseResp
	DEntry string `json:"dentry"`
}

type AdminList

type AdminList struct {
	SysLevel int    `json:"sys_level"`
	UserId   string `json:"userid"`
}

type Agent

type Agent struct {
	AgentName string   `json:"agent_name"`
	AgentId   int64    `json:"agentid"`
	AppId     int64    `json:"appid"`
	LogoUrl   string   `json:"logo_url"`
	AdminList []string `json:"admin_list"`
}

type AuthCorpInfo

type AuthCorpInfo struct {
	CorpLogoUrl     string `json:"corp_logo_url"`
	CorpName        string `json:"corp_name"`
	CorpId          string `json:"corpid"`
	Industry        string `json:"industry"`
	InviteCode      string `json:"invite_code"`
	LicenseCode     string `json:"license_code"`
	AuthChannel     string `json:"auth_channel"`
	AuthChannelType string `json:"auth_channel_type"`
	IsAuthenticated bool   `json:"is_authenticated"`
	AuthLevel       int64  `json:"auth_level"`
	InviteUrl       string `json:"invite_url"`
	CorpProvince    string `json:"corp_province"`
	CorpCity        string `json:"corp_city"`
}

type AuthInfo

type AuthInfo struct {
	Agent []Agent `json:"agent"`
}

type AuthUserInfo

type AuthUserInfo struct {
	UserId string `json:"userId"`
}

type BaseResp

type BaseResp struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

type BeginUploadTransaction

type BeginUploadTransaction struct {
	BaseResp
	UploadId string `json:"upload_id"`
}

type CanAccessMicroAppResp

type CanAccessMicroAppResp struct {
	BaseResp

	CanAccess bool `json:"canAccess"`
}

type CancelTaskGroupRequest

type CancelTaskGroupRequest struct {
	AgentId           int64   `json:"agentid"`
	ProcessInstanceId string  `json:"process_instance_id"`
	ActivityId        *string `json:"activity_id"`
}

type ChannelAgent

type ChannelAgent struct {
	AgentName string `json:"agent_name"`
	AgentId   int64  `json:"agentid"`
	AppId     int64  `json:"appid"`
	LogoUrl   int64  `json:"logo_url"`
}

type ChannelAuthInfo

type ChannelAuthInfo struct {
	ChannelAgent []ChannelAgent `json:"channelAgent"`
}

type CommitUploadTransaction

type CommitUploadTransaction struct {
	BaseResp
	MediaId string `json:"media_id"`
}

type Corp

type Corp struct {
	CorpId      string
	SuiteTicket string
	SuiteKey    string
	SuiteSecret string
}

func NewCorp

func NewCorp(suiteTicket string, corpId string) *Corp

func (*Corp) CreateDingTalkClient

func (corp *Corp) CreateDingTalkClient() (*DingTalkClient, error)

func (*Corp) GetAgent

func (corp *Corp) GetAgent(agentId int64) (GetAgentResp, error)

Desc: 获取授权应用信息 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/vfitg0

func (*Corp) GetAuthInfo

func (corp *Corp) GetAuthInfo() (GetAuthInfoResp, error)

Desc: 获取企业授权信息 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/fmdqvx

func (*Corp) GetCorpToken

func (corp *Corp) GetCorpToken() (GetCorpTokenResp, error)

GetCorpToken can get corporation's token Desc: 获取企业凭证 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/hv357q

type CreateOrUpdateBackLogReq

type CreateOrUpdateBackLogReq struct {
	SaveProcessRequest SaveProcessRequest `json:"SaveProcessRequest"`
}

type CreateOrUpdateBackLogResp

type CreateOrUpdateBackLogResp struct {
	BaseResp

	Result CreateOrUpdateBackLogResult `json:"result"`
}

type CreateOrUpdateBackLogResult

type CreateOrUpdateBackLogResult struct {
	ProcessCode string `json:"process_code"`
}

type CreateProcessInstanceReq

type CreateProcessInstanceReq struct {
	AgentId             *int64                       `json:"agent_id"`
	ProcessCode         string                       `json:"process_code"`
	OriginatorUserId    string                       `json:"originator_user_id"`
	DeptId              int64                        `json:"dept_id"`
	Approvers           string                       `json:"approvers"`
	ApproversV2         *[]ProcessInstanceApproverVo `json:"approvers_v2"`
	CcList              *string                      `json:"cc_list"`
	CcPosition          *string                      `json:"cc_position"`
	FormComponentValues []FormComponentValuesVo      `json:"form_component_values"`
}

type CreateProcessInstanceResp

type CreateProcessInstanceResp struct {
	BaseResp
	ProcessInstanceId string `json:"process_instance_id"`
}

type CreateWorkRecordRequest

type CreateWorkRecordRequest struct {
	AgentId             int64                 `json:"agentid"`
	ProcessCode         string                `json:"process_code"`
	OriginatorUserId    string                `json:"originator_user_id"`
	FormComponentValues []FormComponentValues `json:"form_component_values"`
	Url                 string                `json:"url"`
}

type CreateWorkRecordResp

type CreateWorkRecordResp struct {
	BaseResp

	Result CreateWorkRecordResult `json:"result"`
}

type CreateWorkRecordResult

type CreateWorkRecordResult struct {
	ProcessInstanceId string `json:"process_instance_id"`
}

type CreateWorkRecordTaskRequest

type CreateWorkRecordTaskRequest struct {
	AgentId           int64                     `json:"agentid"`
	ProcessInstanceId string                    `json:"process_instance_id"`
	ActivityId        *string                   `json:"activity_id,omitempty"`
	Tasks             []CreateWorkRecordTaskTop `json:"tasks"`
}

type CreateWorkRecordTaskResp

type CreateWorkRecordTaskResp struct {
	BaseResp

	Tasks []CreateWorkRecordTaskRespTasks `json:"tasks"`
}

type CreateWorkRecordTaskRespTasks

type CreateWorkRecordTaskRespTasks struct {
	TaskId int64  `json:"task_id"`
	UserId string `json:"userid"`
}

type CreateWorkRecordTaskTop

type CreateWorkRecordTaskTop struct {
	UserId string `json:"userid"`
	Url    string `json:"url"`
}

type Crypto

type Crypto struct {
	Token    string
	AesKey   string
	SuiteKey string
	// contains filtered or unexported fields
}
var DefaultDingtalkCrypto *Crypto

func NewCrypto

func NewCrypto(token, aesKey, suiteKey string) (c *Crypto)

token 随机串 aesKey suiteKey 一般使用corpID

func (*Crypto) DecryptMsg

func (c *Crypto) DecryptMsg(signature, timeStamp, nonce, secretStr string) (string, error)

signature: 签名字符串 timeStamp: 时间戳 nonce: 随机字符串 secretStr: 密文 返回: 解密后的明文

func (*Crypto) EncryptMsg

func (c *Crypto) EncryptMsg(replyMsg, timeStamp, nonce string) (string, string, error)

replyMsg: 明文字符串 timeStamp: 时间戳 nonce: 随机字符串 返回: 密文,签名字符串

func (*Crypto) GenerateSignature

func (c *Crypto) GenerateSignature(token, timeStamp, nonce, secretStr string) string

数据签名

func (*Crypto) RandomString

func (c *Crypto) RandomString(n int, alphabets ...byte) string

func (*Crypto) VerifySignature

func (c *Crypto) VerifySignature(token, timeStamp, nonce, secretStr, sigture string) bool

校验数据签名

type DeleteBackLogReq

type DeleteBackLogReq struct {
	AgentId     int64  `json:"agentid"`
	ProcessCode string `json:"process_code"`
}

type DepartmentInfo

type DepartmentInfo struct {
	Id              int64  `json:"id"`
	Name            string `json:"name"`
	ParentId        int64  `json:"parentid"`
	CreateDeptGroup bool   `json:"createDeptGroup"`
	AutoAddUser     bool   `json:"autoAddUser"`
}

type DingTalkClient

type DingTalkClient struct {
	AccessToken string
	AgentId     int64
}

func NewDingTalkClient

func NewDingTalkClient(accessToken string, agentId int64) *DingTalkClient

func (*DingTalkClient) AddFileToUserCSpace

func (client *DingTalkClient) AddFileToUserCSpace(code string, mediaId string, spaceId string, folderId string, name string, overwrite bool) (*AddFileToUserCSpaceResp, error)

Desc: 新增文件到用户钉盘 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/zmmoa5#-6

func (*DingTalkClient) BaseGetDepMemberList

func (client *DingTalkClient) BaseGetDepMemberList(url string, deptId string, lang string, offset int64, size int64, order string) (GetDepMemberListResp, error)

func (*DingTalkClient) BeginUploadChunk

func (client *DingTalkClient) BeginUploadChunk(uploadId string, sequence int, reader io.Reader) (*BaseResp, error)

Desc: 分块上传文件:上传文件块 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/zmmoa5#-12

func (*DingTalkClient) BeginUploadTransaction

func (client *DingTalkClient) BeginUploadTransaction(size int64, count int) (*BeginUploadTransaction, error)

Desc: 分块上传文件:开启分块上传事务 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/zmmoa5#-12

func (*DingTalkClient) CanAccessMicroApp

func (client *DingTalkClient) CanAccessMicroApp(adminId string, appId string) (CanAccessMicroAppResp, error)

Desc: 查询管理员是否具备管理某个应用的权限 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) CancelTaskGroup

func (client *DingTalkClient) CancelTaskGroup(req CancelTaskGroupRequest) (*BaseResp, error)

Desc: 批量取消任务 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/cqukim

func (*DingTalkClient) CommitUploadTransaction

func (client *DingTalkClient) CommitUploadTransaction(size int64, count int, uploadId string) (*CommitUploadTransaction, error)

Desc: 提交文件上传事务 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/zmmoa5#-12

func (*DingTalkClient) CreateOrUpdateBackLog

func (client *DingTalkClient) CreateOrUpdateBackLog(req SaveProcessRequest) (*CreateOrUpdateBackLogResp, error)

Desc: 创建或更新待办模板 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/hhaed5

func (*DingTalkClient) CreateProcessInstance

func (client *DingTalkClient) CreateProcessInstance(createParams CreateProcessInstanceReq) (CreateProcessInstanceResp, error)

发起审批实例 https://open-doc.dingtalk.com/microapp/serverapi3/zzerip

func (*DingTalkClient) CreateWorkRecord

func (client *DingTalkClient) CreateWorkRecord(req CreateWorkRecordRequest, title *string) (*CreateWorkRecordResp, error)

Desc: 创建待办实例 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/gk2b3e

func (*DingTalkClient) CreateWorkRecordTask

func (client *DingTalkClient) CreateWorkRecordTask(req CreateWorkRecordTaskRequest) (*CreateWorkRecordTaskResp, error)

Desc: 创建待办任务 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/ulgaro

func (*DingTalkClient) DeleteBackLog

func (client *DingTalkClient) DeleteBackLog(req DeleteBackLogReq) (*BaseResp, error)

Desc: 删除待办模板 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/dvr6o6

func (*DingTalkClient) FileUploadSingle

func (client *DingTalkClient) FileUploadSingle(path string) (*FileUploadSingleResp, error)

Desc: 单步文件上传 Doc: https://open-doc.dingtalk.com/microapp/serverapi2/wk3krc#g5zpqs

func (*DingTalkClient) FormConditionList

func (client *DingTalkClient) FormConditionList(processCode string, agentId *int64) (FormConditionListResp, error)

查询已设置为条件的表单组件 https://open-doc.dingtalk.com/microapp/serverapi3/yqcw6y

func (*DingTalkClient) GetAdminList

func (client *DingTalkClient) GetAdminList() (GetAdminListResp, error)

Desc: 获取管理员列表 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetAdminScope

func (client *DingTalkClient) GetAdminScope(adminId string) (GetAdminScopeResp, error)

Desc: 获取管理员通讯录权限范围 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetAuthScopes

func (client *DingTalkClient) GetAuthScopes() (GetAuthScopesResp, error)

func (*DingTalkClient) GetCspaceInfo

func (client *DingTalkClient) GetCspaceInfo(userId string) (GetCspaceInfoResp, error)

获取审批钉盘空间信息 https://open-doc.dingtalk.com/microapp/serverapi3/dnh74x

func (*DingTalkClient) GetCustomSpace

func (client *DingTalkClient) GetCustomSpace(domain string) (*GetCustomSpaceResp, error)

Desc: 获取企业下的自定义空间 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/zmmoa5#-7

func (*DingTalkClient) GetDepMemberDetailList

func (client *DingTalkClient) GetDepMemberDetailList(deptId string, lang string, offset int64, size int64, order string) (GetDepMemberListResp, error)

Desc: 获取部门用户详情 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetDepMemberIds

func (client *DingTalkClient) GetDepMemberIds(deptId string) (GetDepMemberIdsResp, error)

Desc: 获取部门用户userid列表 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetDepMemberList

func (client *DingTalkClient) GetDepMemberList(deptId string, lang string, offset int64, size int64, order string) (GetDepMemberListResp, error)

Desc: 获取部门用户 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetDeptDetail

func (client *DingTalkClient) GetDeptDetail(id string, lang *string) (GetDeptDetailResp, error)

获取部门详情 https://open-doc.dingtalk.com/microapp/serverapi3/fuqv8x#-2

func (*DingTalkClient) GetDeptList

func (client *DingTalkClient) GetDeptList(lang *string, fetchChild *bool, id string) (GetDeptListResp, error)

获取部门列表 https://open-doc.dingtalk.com/microapp/serverapi3/fuqv8x#-1

func (*DingTalkClient) GetExtcontactDetail

func (client *DingTalkClient) GetExtcontactDetail(userId string) (GetExtcontactDetailResp, error)

获取外部联系人详情 https://open-doc.dingtalk.com/microapp/serverapi3/grk4nv#-2

func (*DingTalkClient) GetExtcontactList

func (client *DingTalkClient) GetExtcontactList(size string, offset string) (GetExtcontactListResp, error)

获取外部联系人列表 https://open-doc.dingtalk.com/microapp/serverapi3/grk4nv#-1

func (*DingTalkClient) GetJsApiTicket

func (client *DingTalkClient) GetJsApiTicket(authType string) (*GetJsApiTicketResp, error)

Desc: 获取jsapi_ticket Doc: https://open-doc.dingtalk.com/microapp/dev/uwa7vs

func (*DingTalkClient) GetOrderInfo

func (client *DingTalkClient) GetOrderInfo(orderId int64) (GetOrderInfoResp, error)

获取内购订单信息

func (*DingTalkClient) GetOrgUserCount

func (client *DingTalkClient) GetOrgUserCount(onlyActive int) (GetOrgUserCountResp, error)

Desc: 获取企业员工人数 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetProcessInstanceInfo

func (client *DingTalkClient) GetProcessInstanceInfo(processInstanceId string) (GetProcessInstanceInfoResp, error)

获取审批实例详情 https://open-doc.dingtalk.com/microapp/serverapi3/tkgfol

func (*DingTalkClient) GetRoleDetail

func (client *DingTalkClient) GetRoleDetail(roleId int64) (GetRoleDetailResp, error)

Desc: 获取角色详情 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/qydf9c

func (*DingTalkClient) GetRoleGroup

func (client *DingTalkClient) GetRoleGroup(groupId int64) (GetRoleGroupResp, error)

Desc: 获取角色组 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/qydf9c

func (*DingTalkClient) GetRoleList

func (client *DingTalkClient) GetRoleList(offset int, size int) (GetRoleListResp, error)

Desc: 获取角色列表 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/qydf9c

func (*DingTalkClient) GetSkuPage

func (client *DingTalkClient) GetSkuPage(goodsCode string, callBackPage string) (GetSkuPageResp, error)

获取内购商品SKU页面地址

func (*DingTalkClient) GetSubDept

func (client *DingTalkClient) GetSubDept(id string) (GetSubdeptResp, error)

获取子部门ID列表 https://open-doc.dingtalk.com/microapp/serverapi3/fuqv8x#hvdqc

func (*DingTalkClient) GetUserDetail

func (client *DingTalkClient) GetUserDetail(userId string, lang *string) (GetUserDetailResp, error)

Desc: 获取用户详情 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetUserIdByUnionId

func (client *DingTalkClient) GetUserIdByUnionId(unionId string) (GetUserIdByUnionIdResp, error)

Desc: 根据unionid获取userid Doc: https://open-doc.dingtalk.com/microapp/serverapi3/momrx5

func (*DingTalkClient) GetUserInfoFromAdmin

func (client *DingTalkClient) GetUserInfoFromAdmin(code string) (GetUserInfoFromAdminResp, error)

应用管理后台免登(获取应用管理员的身份信息) https://open-doc.dingtalk.com/microapp/serverapi3/ydc8us

func (*DingTalkClient) GetUserInfoFromThird

func (client *DingTalkClient) GetUserInfoFromThird(code string) (GetUserInfoFromThirdResp, error)

第三方企业应用免登(获取用户userid) https://open-doc.dingtalk.com/microapp/serverapi3/xcdh0r

func (*DingTalkClient) GetUsersInRole

func (client *DingTalkClient) GetUsersInRole(roleId int64, offset int, size int) (GetUsersInRoleResp, error)

Desc: 获取角色下的员工列表 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/qydf9c

func (*DingTalkClient) GetWorkNoticeProgress

func (client *DingTalkClient) GetWorkNoticeProgress(taskId int64) (GetWorkNoticeProgressResp, error)

Desc: 查询工作通知消息的发送进度 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/is3zms#

func (*DingTalkClient) GetWorkNoticeSendResult

func (client *DingTalkClient) GetWorkNoticeSendResult(taskId int64) (GetWorkNoticeResultResp, error)

Desc: 查询工作通知消息的发送结果 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/is3zms#

func (*DingTalkClient) GrantCustomSpace

func (client *DingTalkClient) GrantCustomSpace(domain string, grantType string, userId string, path string, fileIds string, duration int) (*BaseResp, error)

Desc: 授权用户访问企业自定义空间 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/zmmoa5#-8

func (*DingTalkClient) ListLabelGroups

func (client *DingTalkClient) ListLabelGroups(size string, offset string) (ListLabelGroupsResp, error)

获取外部联系人标签列表 https://open-doc.dingtalk.com/microapp/serverapi3/grk4nv#khcve

func (*DingTalkClient) ListParentDepts

func (client *DingTalkClient) ListParentDepts(userId string) (ListParentDeptsResp, error)

查询指定用户的所有上级父部门路径 https://open-doc.dingtalk.com/microapp/serverapi3/fuqv8x#-4

func (*DingTalkClient) ListParentDeptsByDept

func (client *DingTalkClient) ListParentDeptsByDept(id string) (ListParentDeptsByDeptResp, error)

查询部门的所有上级父部门路径 https://open-doc.dingtalk.com/microapp/serverapi3/fuqv8x#-3

func (*DingTalkClient) OrderConsume

func (client *DingTalkClient) OrderConsume(orderId int64, requestId string, quantity int, userId string) (*BaseResp, error)

应用内购商品核销

func (*DingTalkClient) OrderFinish

func (client *DingTalkClient) OrderFinish(orderId int64) (*BaseResp, error)

内购商品订单处理完成

func (*DingTalkClient) RecallWorkNotice

func (client *DingTalkClient) RecallWorkNotice(taskId int64) (WorkNoticeRecallResp, error)

Desc: 工作通知消息撤回 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/is3zms#

func (*DingTalkClient) SaveProcess

func (client *DingTalkClient) SaveProcess(saveProcessRequest SaveProcessReq, fakeMode *bool, templateEditUrl *string) (SaveProcessResp, error)

创建或更新审批模板 https://open-doc.dingtalk.com/microapp/serverapi3/svyi4c

func (*DingTalkClient) SendDingPanFileToSingleChat

func (client *DingTalkClient) SendDingPanFileToSingleChat(userId string, mediaId string, fileName string) (*BaseResp, error)

Desc: 发送钉盘文件给指定用户 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/zmmoa5#-5

func (*DingTalkClient) SendNormalNotice

func (client *DingTalkClient) SendNormalNotice(sender string, cid string, msg WorkNoticeMsg) (SendNormalNoticeResp, error)

Desc: 发送普通消息 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/wvdxel

func (*DingTalkClient) SendWorkNotice

func (client *DingTalkClient) SendWorkNotice(userIdList *string, deptIdList *string, toAllUser bool, msg WorkNoticeMsg) (SendWorkNoticeResp, error)

Desc: 工作通知消息 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/is3zms

func (*DingTalkClient) UpdateWorkRecord

func (client *DingTalkClient) UpdateWorkRecord(req UpdateWorkRecordRequest) (*BaseResp, error)

Desc: 更新实例状态 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/vo0gqo

func (*DingTalkClient) UpdateWorkRecordTask

func (client *DingTalkClient) UpdateWorkRecordTask(req UpdateWorkRecordTaskRequest) (*CreateWorkRecordTaskResp, error)

Desc: 更新任务状态 Doc: https://open-doc.dingtalk.com/microapp/serverapi3/sbl5ms

func (*DingTalkClient) UploadMedia

func (client *DingTalkClient) UploadMedia(mediaType string, path string) (UploadMediaResp, error)

type DingTalkOauthClient

type DingTalkOauthClient struct {
	OauthAppId     string
	OauthAppSecret string
}

func NewDingTalkOauthClient

func NewDingTalkOauthClient() *DingTalkOauthClient

func (*DingTalkOauthClient) GetUserInfoByCode

func (client *DingTalkOauthClient) GetUserInfoByCode(code string) (GetUserInfoByCodeResp, error)

服务端通过临时授权码获取授权用户的个人信息 https://open-doc.dingtalk.com/microapp/serverapi3/vmzkak

type DingTalkSDK

type DingTalkSDK struct {
	SuiteKey    string
	SuiteSecret string
	Token       string
	AesKey      string
	AppId       int64
}

func NewSDK

func NewSDK() *DingTalkSDK

func (*DingTalkSDK) ActivateSuite

func (s *DingTalkSDK) ActivateSuite(suiteAccessToken string, authCorpId string, permanentCode string) (*BaseResp, error)

func (*DingTalkSDK) CreateCorp

func (s *DingTalkSDK) CreateCorp(corpId string, suiteTicket string) *Corp

func (*DingTalkSDK) CreateCrypto

func (s *DingTalkSDK) CreateCrypto() *Crypto

func (*DingTalkSDK) GetPermanentCode

func (s *DingTalkSDK) GetPermanentCode(suiteAccessToken string, tmpAuthCode string) (*GetPermanentCodeResp, error)

func (*DingTalkSDK) GetSuiteToken

func (s *DingTalkSDK) GetSuiteToken(suiteTicket string) (*GetSuiteAccessTokenResp, error)

func (*DingTalkSDK) GetUnfinishOrderList

func (s *DingTalkSDK) GetUnfinishOrderList(suiteAccessToken string, itemCode string, page int64, size int64) (GetUnfinishOrderListResp, error)

获取未处理的已支付订单

type ExtcontactDetail

type ExtcontactDetail struct {
	Title          string   `json:"title"`
	ShareDeptIds   []int64  `json:"share_dept_ids"`
	LabelIds       []int64  `json:"label_ids"`
	Remark         string   `json:"remark"`
	Address        string   `json:"address"`
	Name           string   `json:"name"`
	FollowerUserId string   `json:"follower_user_id"`
	StateCode      string   `json:"state_code"`
	CompanyName    string   `json:"company_name"`
	ShareUserIds   []string `json:"share_user_ids"`
	UserId         string   `json:"userid"`
}

type FileNotice

type FileNotice struct {
	MediaId string `json:"media_id"`
}

type FileUploadSingleResp

type FileUploadSingleResp struct {
	BaseResp

	MediaId string `json:"media_id"`
}

type FormComponentList

type FormComponentList struct {
	ComponentName string `json:"component_name"`
	Props         Props  `json:"props"`
}

type FormComponentPropVo

type FormComponentPropVo struct {
	Id          string                 `json:"id"`
	Label       string                 `json:"label"`
	Required    *bool                  `json:"required"`
	NotPrint    *string                `json:"not_print"`
	Placeholder *string                `json:"placeholder"`
	NotUpper    *string                `json:"not_upper"`
	Unit        *string                `json:"unit"`
	Options     *[]string              `json:"options"`
	Choice      *int64                 `json:"choice"`
	Link        *string                `json:"link"`
	ActionName  *string                `json:"action_name"`
	StatField   *[]FormComponentStatVo `json:"stat_field"`
}

type FormComponentStatVo

type FormComponentStatVo struct {
	Id    *string `json:"id"`
	Label *string `json:"label"`
	Upper *bool   `json:"upper"`
	Unit  *string `json:"unit"`
}

type FormComponentValues

type FormComponentValues struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type FormComponentValuesVo

type FormComponentValuesVo struct {
	Name     string `json:"name"`
	Value    string `json:"value"`
	ExtValue string `json:"ext_value"`
}

type FormComponentVo

type FormComponentVo struct {
	ComponentName string              `json:"component_name"`
	Props         FormComponentPropVo `json:"props"`
	Children      *FormComponentVo    `json:"children"`
}

type FormConditionListResp

type FormConditionListResp struct {
	BaseResp
	Result struct {
		List struct {
			Id    string `json:"id"`
			Label string `json:"label"`
		} `json:"list"`
	} `json:"result"`
}

type GetAdminListResp

type GetAdminListResp struct {
	BaseResp

	AdminList []AdminList `json:"admin_list"`
}

type GetAdminScopeResp

type GetAdminScopeResp struct {
	BaseResp

	DeptIds []int64 `json:"dept_ids"`
}

type GetAgentResp

type GetAgentResp struct {
	BaseResp

	AgentId     int64  `json:"agentid"`
	Name        string `json:"name"`
	LogoUrl     string `json:"logo_url"`
	Description string `json:"description"`
	Close       int64  `json:"close"`
}

======================== 获取授权应用信息: https://open-doc.dingtalk.com/microapp/serverapi3/vfitg0

type GetAuthInfoResp

type GetAuthInfoResp struct {
	BaseResp

	AuthCorpInfo    AuthCorpInfo    `json:"auth_corp_info"`
	AuthUserInfo    AuthUserInfo    `json:"auth_user_info"`
	AuthInfo        AuthInfo        `json:"auth_info"`
	ChannelAuthInfo ChannelAuthInfo `json:"channel_auth_info"`
}

======================== 获取企业授权信息: https://open-doc.dingtalk.com/microapp/serverapi3/hv357q

type GetAuthScopesData

type GetAuthScopesData struct {
	AuthedDept []int64  `json:"authed_dept"`
	AuthedUser []string `json:"authed_user"`
}

type GetAuthScopesResp

type GetAuthScopesResp struct {
	BaseResp
	AuthUserField  []string          `json:"auth_user_field"`
	ConditionField []string          `json:"condition_field"`
	AuthOrgScopes  GetAuthScopesData `json:"auth_org_scopes"`
}

type GetCorpTokenResp

type GetCorpTokenResp struct {
	BaseResp

	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
}

======================== 获取企业凭证: https://open-doc.dingtalk.com/microapp/serverapi3/vfitg0

type GetCspaceInfoResp

type GetCspaceInfoResp struct {
	BaseResp
	Result struct {
		SpaceId int64 `json:"space_id"`
	} `json:"result"`
	Success bool `json:"success"`
}

type GetCustomSpaceResp

type GetCustomSpaceResp struct {
	BaseResp
	SpaceId string `json:"spaceid"`
}

type GetDepMemberIdsResp

type GetDepMemberIdsResp struct {
	BaseResp
	UserIds []string `json:"userIds"`
}

type GetDepMemberListResp

type GetDepMemberListResp struct {
	BaseResp

	HasMore  bool       `json:"hasMore"`
	UserList []UserList `json:"userlist"`
}

type GetDeptDetailResp

type GetDeptDetailResp struct {
	BaseResp
	Id                    int64  `json:"id"`
	Name                  string `json:"name"`
	Order                 int64  `json:"order"`
	ParentId              int64  `json:"parentid"`
	CreateDeptGroup       bool   `json:"createDeptGroup"`
	AutoAddUser           bool   `json:"autoAddUser"`
	DeptHiding            bool   `json:"deptHiding"`
	DeptPermits           string `json:"deptPermits"`
	UserPermits           string `json:"userPermits"`
	OuterDept             bool   `json:"outerDept"`
	OuterPermitDepts      string `json:"outerPermitDepts"`
	OuterPermitUsers      string `json:"outerPermitUsers"`
	OrgDeptOwner          string `json:"orgDeptOwner"`
	DeptManagerUseridList string `json:"deptManagerUseridList"`
	SourceIdentifier      string `json:"sourceIdentifier"`
}

type GetDeptListResp

type GetDeptListResp struct {
	BaseResp
	Department []DepartmentInfo `json:"department"`
}

type GetExtcontactDetailResp

type GetExtcontactDetailResp struct {
	BaseResp
	Result ExtcontactDetail `json:"result"`
}

type GetExtcontactListResp

type GetExtcontactListResp struct {
	BaseResp
	Results []ExtcontactDetail `json:"results"`
}

type GetJsApiTicketResp

type GetJsApiTicketResp struct {
	BaseResp

	Ticket    string `json:"ticket"`
	ExpiresIn int64  `json:"expires_in"`
}

type GetOrderInfoResp

type GetOrderInfoResp struct {
	BaseResp
	Result OrderInfo `json:"result"`
}

type GetOrgUserCountResp

type GetOrgUserCountResp struct {
	BaseResp

	Count int64 `json:"count"`
}

type GetPermanentCodeResp

type GetPermanentCodeResp struct {
	PermanentCode string       `json:"permanent_code"`
	AuthCorpInfo  AuthCorpInfo `json:"auth_corp_info"`
}

type GetProcessInstanceInfoResp

type GetProcessInstanceInfoResp struct {
	BaseResp
	ProcessInstance ProcessInstanceVo `json:"process_instance"`
}

type GetRoleDetailResp

type GetRoleDetailResp struct {
	BaseResp

	Role Role `json:"role"`
}

type GetRoleGroupResp

type GetRoleGroupResp struct {
	BaseResp

	RoleGroup RoleGroupV1 `json:"role_group"`
}

type GetRoleListResp

type GetRoleListResp struct {
	BaseResp

	Result GetRoleListResult `json:"result"`
}

type GetRoleListResult

type GetRoleListResult struct {
	HasMore  bool        `json:"hasMore"`
	RoleList []RoleGroup `json:"list"`
}

type GetSkuPageResp

type GetSkuPageResp struct {
	BaseResp
	Result string `json:"result"`
}

type GetSubdeptResp

type GetSubdeptResp struct {
	BaseResp
	SubDeptIdList []int64 `json:"sub_dept_id_list"`
}

type GetSuiteAccessTokenResp

type GetSuiteAccessTokenResp struct {
	SuiteAccessToken string `json:"suite_access_token"`
	ExpiresIn        int64  `json:"expires_in"`
}

type GetUnfinishOrderListResp

type GetUnfinishOrderListResp struct {
	BaseResp
	Result UnfinishOrderList `json:"result"`
}

type GetUserDetailResp

type GetUserDetailResp struct {
	BaseResp

	UserList
}

type GetUserIdByUnionIdResp

type GetUserIdByUnionIdResp struct {
	BaseResp

	ContactType int    `json:"contactType"`
	UserId      string `json:"userid"`
}

type GetUserInRoleResult

type GetUserInRoleResult struct {
	HasMore    bool       `json:"hasMore"`
	NextCursor int64      `json:"nextCursor"`
	UserList   []UserList `json:"list"`
}

type GetUserInfoByCodeResp

type GetUserInfoByCodeResp struct {
	BaseResp
	UserInfo struct {
		Nick    string `json:"nick"`
		OpenId  string `json:"openid"`
		UnionId string `json:"unionid"`
	} `json:"user_info"`
}

type GetUserInfoFromAdminResp

type GetUserInfoFromAdminResp struct {
	BaseResp
	CropInfo struct {
		CropName string `json:"crop_name"`
		CropId   string `json:"cropid"`
	}
	IsSys    bool `json:"is_sys"`
	UserInfo struct {
		Avatar string `json:"avatar"`
		Email  string `json:"email"`
		Name   string `json:"name"`
		UserId string `json:"userid"`
	} `json:"user_info"`
}

type GetUserInfoFromThirdResp

type GetUserInfoFromThirdResp struct {
	BaseResp
	UserId   string `json:"userid"`
	SysLevel int64  `json:"sys_level"`
	IsSys    bool   `json:"is_sys"`
	DeviceId string `json:"deviceId"`
}

type GetUsersInRoleResp

type GetUsersInRoleResp struct {
	BaseResp

	Result GetUserInRoleResult `json:"result"`
}

type GetWorkNoticeProgressResp

type GetWorkNoticeProgressResp struct {
	BaseResp

	Progress NoticeProgress `json:"progress"`
}

type GetWorkNoticeResultResp

type GetWorkNoticeResultResp struct {
	BaseResp

	SendResult NoticeSendResult `json:"send_result"`
}

type ImageNotice

type ImageNotice struct {
	MediaId string `json:"media_id"`
}

type Labels

type Labels struct {
	Name string `json:"name"`
	Id   int64  `json:"id"`
}

type LinkNotice

type LinkNotice struct {
	MsgUrl string `json:"messageUrl"`
	PicUrl string `json:"picUrl"`
	Title  string `json:"title"`
	Text   string `json:"text"`
}

type ListLabelGroupsResp

type ListLabelGroupsResp struct {
	BaseResp
	Results []struct {
		Name   string   `json:"name"`
		Color  int64    `json:"color"`
		Labels []Labels `json:"labels"`
	}
}

type ListParentDeptsByDeptResp

type ListParentDeptsByDeptResp struct {
	BaseResp
	ParentIds []int64 `json:"parentIds"`
}

type ListParentDeptsResp

type ListParentDeptsResp struct {
	BaseResp
	Department [][]int64 `json:"department"`
}

type MarkdownNotice

type MarkdownNotice struct {
	Title string `json:"title"`
	Text  string `json:"text"`
}

type NoticeProgress

type NoticeProgress struct {
	ProgressInPercent int64 `json:"progress_in_percent"`
	Status            int64 `json:"status"`
}

type NoticeSendResult

type NoticeSendResult struct {
	InvalidUserIdList   []string `json:"invalid_user_id_list"`
	ForbiddenUserIdList []string `json:"forbidden_user_id_list"`
	FailedUserIdList    []string `json:"failed_user_id_list"`
	ReadUserIdList      []string `json:"read_user_id_list"`
	UnreadUserIdList    []string `json:"unread_user_id_list"`
	InvalidDeptIdList   []string `json:"invalid_dept_id_list"`
}

type OANotice

type OANotice struct {
	MsgUrl string       `json:"message_url"`
	Head   OANoticeHead `json:"head"`
	Body   OANoticeBody `json:"body"`
}

type OANoticeBody

type OANoticeBody struct {
	Title     *string             `json:"title"`
	Form      *[]OANoticeBodyForm `json:"form"`
	Rich      *OANoticeBodyRich   `json:"rich"`
	Content   *string             `json:"content"`
	Image     *string             `json:"image"`
	FileCount *string             `json:"file_count"`
	Author    *string             `json:"author"`
}

type OANoticeBodyForm

type OANoticeBodyForm struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type OANoticeBodyRich

type OANoticeBodyRich struct {
	Num  string `json:"num"`
	Unit string `json:"unit"`
}

type OANoticeHead

type OANoticeHead struct {
	BgColor string `json:"bgcolor"`
	Text    string `json:"text"`
}

type OperationRecordsVo

type OperationRecordsVo struct {
	UserId          string `json:"userid"`
	Date            string `json:"date"`
	OperationResult string `json:"operation_result"`
	Remark          string `json:"remark"`
}

type OrderInfo

type OrderInfo struct {
	CreateTimestamp   int64  `json:"create_timestamp"`
	StartTimestamp    int64  `json:"start_timestamp"`
	EndTimestamp      int64  `json:"end_timestamp"`
	PaidTimestamp     int64  `json:"paid_timestamp"`
	Quantity          int    `json:"quantity"`
	Status            int    `json:"status"`
	TotalActualPayFee int64  `json:"total_actual_pay_fee"`
	GoodsCode         string `json:"goods_code"`
	ItemCode          string `json:"item_code"`
	CorpId            string `json:"corp_id"`
	BizOrderId        int64  `json:"biz_order_id"`
}

type ProcessInstanceApproverVo

type ProcessInstanceApproverVo struct {
	UserIds        *[]string `json:"user_ids"`
	TaskActionType *string   `json:"task_action_type"`
}

type ProcessInstanceVo

type ProcessInstanceVo struct {
	Title                      string                  `json:"title"`
	CreateTime                 string                  `json:"create_time"`
	FinishTime                 string                  `json:"finish_time"`
	OriginatorUserId           string                  `json:"originator_userid"`
	OriginatorDeptId           string                  `json:"originator_dept_id"`
	Status                     string                  `json:"status"`
	CcUserIds                  string                  `json:"cc_userids"`
	FormComponentValues        []FormComponentValuesVo `json:"form_component_values"`
	Result                     string                  `json:"result"`
	BusinessId                 string                  `json:"business_id"`
	OperationRecords           []OperationRecordsVo    `json:"operation_records"`
	Tasks                      []TasksVo               `json:"tasks"`
	OriginatorDeptName         string                  `json:"originator_dept_name"`
	BizAction                  string                  `json:"biz_action"`
	AttachedProcessInstanceIds []string                `json:"attached_process_instance_ids"`
}

type Props

type Props struct {
	Id          string `json:"id"`
	Label       string `json:"label"`
	Required    bool   `json:"required"`
	Unit        string `json:"unit,omitempty"`
	Placeholder string `json:"placeholder"`
}

type Role

type Role struct {
	Name string `json:"name"`
	Id   int64  `json:"id"`
}

type RoleGroup

type RoleGroup struct {
	Name    string `json:"name"`
	GroupId int64  `json:"groupId"`
	Roles   []Role `json:"roles"`
}

type RoleGroupV1

type RoleGroupV1 struct {
	Name  string   `json:"group_name"`
	Roles []RoleV1 `json:"roles"`
}

type RoleV1

type RoleV1 struct {
	Name string `json:"role_name"`
	Id   int64  `json:"role_id"`
}

type SaveProcessReq

type SaveProcessReq struct {
	ProcessCode       *string           `json:"process_code"`
	AgentId           int64             `json:"agentid"`
	DisableFormEdit   *string           `json:"disable_form_edit"`
	Name              string            `json:"name"`
	Description       string            `json:"description"`
	FormComponentList []FormComponentVo `json:"form_component_list"`
}

type SaveProcessRequest

type SaveProcessRequest struct {
	AgentId           int64               `json:"agentid"`
	ProcessCode       string              `json:"process_code,omitempty"`
	Name              string              `json:"name"`
	Description       string              `json:"description"`
	FormComponentList []FormComponentList `json:"form_component_list"`
	FakeMode          bool                `json:"fake_mode"`
}

type SaveProcessResp

type SaveProcessResp struct {
	BaseResp
	Result struct {
		ProcessCode string `json:"process_code"`
	} `json:"result"`
}

type SendNormalNoticeResp

type SendNormalNoticeResp struct {
	BaseResp

	Receiver string `json:"receiver"`
}

type SendWorkNoticeResp

type SendWorkNoticeResp struct {
	BaseResp

	TaskId int64 `json:"task_id"`
}

type TasksVo

type TasksVo struct {
	UserId     string `json:"userid"`
	TaskStatus string `json:"task_status"`
	TaskResult string `json:"task_result"`
	CreateTime string `json:"create_time"`
	FinishTime string `json:"finish_time"`
	TaskId     string `json:"taskid"`
}

type TextNotice

type TextNotice struct {
	Content string `json:"content"`
}

type UnfinishOrderInfo

type UnfinishOrderInfo struct {
	BizOrderId        int64  `json:"biz_order_id"`
	CorpId            string `json:"corp_id"`
	CreateTimestamp   int64  `json:"create_timestamp"`
	GoodsCode         string `json:"goods_code"`
	ItemCode          string `json:"item_code"`
	PaidTimestamp     int64  `json:"paid_timestamp"`
	Quantity          int    `json:"quantity"`
	Status            int    `json:"status"`
	TotalActualPayFee int64  `json:"total_actual_pay_fee"`
}

type UnfinishOrderList

type UnfinishOrderList struct {
	Items []UnfinishOrderInfo `json:"items"`
}

type UpdateWorkRecordRequest

type UpdateWorkRecordRequest struct {
	AgentId           int64  `json:"agentid"`
	ProcessInstanceId string `json:"process_instance_id"`
	Status            string `json:"status"`
	Result            string `json:"result,omitempty"`
}

type UpdateWorkRecordTaskRequest

type UpdateWorkRecordTaskRequest struct {
	AgentId           int64                     `json:"agentid"`
	ProcessInstanceId string                    `json:"process_instance_id"`
	Tasks             []UpdateWorkRecordTaskTop `json:"tasks"`
}

type UpdateWorkRecordTaskResp

type UpdateWorkRecordTaskResp struct {
	CreateWorkRecordTaskResp
}

type UpdateWorkRecordTaskTop

type UpdateWorkRecordTaskTop struct {
	TaskId int64  `json:"task_id"`
	Status string `json:"status"`
	Result string `json:"result,omitempty"`
}

type UploadMediaResp

type UploadMediaResp struct {
	BaseResp

	Type      string `json:"type"`
	MediaId   string `json:"media_id"`
	CreatedAt int64  `json:"created_at"`
}

type UserDetailRole

type UserDetailRole struct {
	Id        int64  `json:"id"`
	Name      string `json:"name"`
	GroupName string `json:"groupName"`
}

type UserList

type UserList struct {
	Name            string           `json:"name"`
	UnionId         string           `json:"unionid"`
	UserId          string           `json:"userid"`
	IsLeaderInDepts string           `json:"isLeaderInDepts"`
	IsBoos          bool             `json:"isBoss"`
	HiredDate       int64            `json:"hiredDate"`
	IsSenior        bool             `json:"isSenior"`
	Department      []int64          `json:"department"`
	OrderInDepts    string           `json:"orderInDepts"`
	Active          bool             `json:"active"`
	Avatar          string           `json:"avatar"`
	IsAdmin         bool             `json:"isAdmin"`
	IsHide          bool             `json:"isHide"`
	JobNumber       string           `json:"jobnumber"`
	Position        string           `json:"position"`
	DingId          string           `json:"dingId"`
	Roles           []UserDetailRole `json:"roles"`
}

type VoiceNotice

type VoiceNotice struct {
	MediaId  string `json:"media_id"`
	Duration string `json:"duration"`
}

type WorkNoticeMsg

type WorkNoticeMsg struct {
	MsgType    string            `json:"msgtype"`
	Text       *TextNotice       `json:"text"`
	Image      *ImageNotice      `json:"image"`
	Voice      *VoiceNotice      `json:"voice"`
	File       *FileNotice       `json:"file"`
	Link       *LinkNotice       `json:"link"`
	OA         *OANotice         `json:"oa"`
	Markdown   *MarkdownNotice   `json:"markdown"`
	ActionCard *ActionCardNotice `json:"action_card"`
}

type WorkNoticeRecallResp

type WorkNoticeRecallResp struct {
	BaseResp
}

Jump to

Keyboard shortcuts

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