Versions in this module Expand all Collapse all v0 v0.1.2 Apr 3, 2020 v0.1.1 Mar 26, 2020 Changes in this version type UserList + Mobile string + StateCode string + WorkPlace string v0.1.0 Mar 25, 2020 Changes in this version + func GetToken(appkey, appsecret string, sso bool) (string, error) + func RandomString(n int, alphabets ...byte) string type GetUserInfoFromAdminResp + func GetUserInfoFromAdmin(accessToken, code string) (*GetUserInfoFromAdminResp, error) v0.0.9 Mar 23, 2020 Changes in this version + const AES_ENCODE_KEY_LENGTH + func CalculateJsApiSign(ticket string, nonceStr string, timestamp int64, url string) string + func CorpAuth(url string, suiteKey string, suiteSecret string, suiteTicket string, ...) (string, error) + func Ddbase64sign(key string) (bt []byte, err error) + func ExcuteOapi(url string, accessKey string, accessSecret string, suiteTicket string, ...) (string, error) + func PKCS7Padding(ciphertext []byte, blockSize int) []byte + func PKCS7UnPadding(plantText []byte) []byte + func RobotSender(webHook string, msg WorkNoticeMsg) + type ActionCardBtnJsonList struct + ActionUrl string + Title string + type ActionCardNotice struct + BtnJsonList *[]ActionCardBtnJsonList + BtnOrientation *int64 + Markdown string + SingleTitle *string + SingleUrl *string + Title string + type AddFileToUserCSpaceResp struct + DEntry string + type AdminList struct + SysLevel int + UserId string + type Agent struct + AdminList []string + AgentId int64 + AgentName string + AppId int64 + LogoUrl string + type AuthCorpInfo struct + AuthChannel string + AuthChannelType string + AuthLevel int64 + CorpCity string + CorpId string + CorpLogoUrl string + CorpName string + CorpProvince string + Industry string + InviteCode string + InviteUrl string + IsAuthenticated bool + LicenseCode string + type AuthInfo struct + Agent []Agent + type AuthUserInfo struct + UserId string + type BaseResp struct + ErrCode int + ErrMsg string + type BeginUploadTransaction struct + UploadId string + type CanAccessMicroAppResp struct + CanAccess bool + type CancelTaskGroupRequest struct + ActivityId *string + AgentId int64 + ProcessInstanceId string + type ChannelAgent struct + AgentId int64 + AgentName string + AppId int64 + LogoUrl int64 + type ChannelAuthInfo struct + ChannelAgent []ChannelAgent + type CommitUploadTransaction struct + MediaId string + type Corp struct + CorpId string + SuiteKey string + SuiteSecret string + SuiteTicket string + func NewCorp(suiteTicket string, corpId string) *Corp + func (corp *Corp) CreateDingTalkClient() (*DingTalkClient, error) + func (corp *Corp) GetAgent(agentId int64) (GetAgentResp, error) + func (corp *Corp) GetAuthInfo() (GetAuthInfoResp, error) + func (corp *Corp) GetCorpToken() (GetCorpTokenResp, error) + type CreateOrUpdateBackLogReq struct + SaveProcessRequest SaveProcessRequest + type CreateOrUpdateBackLogResp struct + Result CreateOrUpdateBackLogResult + type CreateOrUpdateBackLogResult struct + ProcessCode string + type CreateProcessInstanceReq struct + AgentId *int64 + Approvers string + ApproversV2 *[]ProcessInstanceApproverVo + CcList *string + CcPosition *string + DeptId int64 + FormComponentValues []FormComponentValuesVo + OriginatorUserId string + ProcessCode string + type CreateProcessInstanceResp struct + ProcessInstanceId string + type CreateWorkRecordRequest struct + AgentId int64 + FormComponentValues []FormComponentValues + OriginatorUserId string + ProcessCode string + Url string + type CreateWorkRecordResp struct + Result CreateWorkRecordResult + type CreateWorkRecordResult struct + ProcessInstanceId string + type CreateWorkRecordTaskRequest struct + ActivityId *string + AgentId int64 + ProcessInstanceId string + Tasks []CreateWorkRecordTaskTop + type CreateWorkRecordTaskResp struct + Tasks []CreateWorkRecordTaskRespTasks + type CreateWorkRecordTaskRespTasks struct + TaskId int64 + UserId string + type CreateWorkRecordTaskTop struct + Url string + UserId string + type Crypto struct + AesKey string + CropId string + SuiteKey string + Token string + var DefaultDingtalkCrypto *Crypto + func NewCrypto(token, aesKey, suiteKey string) (c *Crypto) + func (c *Crypto) DecryptMsg(signature, timeStamp, nonce, secretStr string) (string, error) + func (c *Crypto) EncryptMsg(replyMsg, timeStamp, nonce string) (string, string, error) + func (c *Crypto) GenerateSignature(token, timeStamp, nonce, secretStr string) string + func (c *Crypto) RandomString(n int, alphabets ...byte) string + func (c *Crypto) VerifySignature(token, timeStamp, nonce, secretStr, sigture string) bool + type DeleteBackLogReq struct + AgentId int64 + ProcessCode string + type DepartmentInfo struct + AutoAddUser bool + CreateDeptGroup bool + Id int64 + Name string + ParentId int64 + type DingTalkClient struct + AccessToken string + AgentId int64 + func NewDingTalkClient(accessToken string, agentId int64) *DingTalkClient + func (client *DingTalkClient) AddFileToUserCSpace(code string, mediaId string, spaceId string, folderId string, name string, ...) (*AddFileToUserCSpaceResp, error) + func (client *DingTalkClient) BaseGetDepMemberList(url string, deptId string, lang string, offset int64, size int64, order string) (GetDepMemberListResp, error) + func (client *DingTalkClient) BeginUploadChunk(uploadId string, sequence int, reader io.Reader) (*BaseResp, error) + func (client *DingTalkClient) BeginUploadTransaction(size int64, count int) (*BeginUploadTransaction, error) + func (client *DingTalkClient) CanAccessMicroApp(adminId string, appId string) (CanAccessMicroAppResp, error) + func (client *DingTalkClient) CancelTaskGroup(req CancelTaskGroupRequest) (*BaseResp, error) + func (client *DingTalkClient) CommitUploadTransaction(size int64, count int, uploadId string) (*CommitUploadTransaction, error) + func (client *DingTalkClient) CreateOrUpdateBackLog(req SaveProcessRequest) (*CreateOrUpdateBackLogResp, error) + func (client *DingTalkClient) CreateProcessInstance(createParams CreateProcessInstanceReq) (CreateProcessInstanceResp, error) + func (client *DingTalkClient) CreateWorkRecord(req CreateWorkRecordRequest, title *string) (*CreateWorkRecordResp, error) + func (client *DingTalkClient) CreateWorkRecordTask(req CreateWorkRecordTaskRequest) (*CreateWorkRecordTaskResp, error) + func (client *DingTalkClient) DeleteBackLog(req DeleteBackLogReq) (*BaseResp, error) + func (client *DingTalkClient) FileUploadSingle(path string) (*FileUploadSingleResp, error) + func (client *DingTalkClient) FormConditionList(processCode string, agentId *int64) (FormConditionListResp, error) + func (client *DingTalkClient) GetAdminList() (GetAdminListResp, error) + func (client *DingTalkClient) GetAdminScope(adminId string) (GetAdminScopeResp, error) + func (client *DingTalkClient) GetAuthScopes() (GetAuthScopesResp, error) + func (client *DingTalkClient) GetCspaceInfo(userId string) (GetCspaceInfoResp, error) + func (client *DingTalkClient) GetCustomSpace(domain string) (*GetCustomSpaceResp, error) + func (client *DingTalkClient) GetDepMemberDetailList(deptId string, lang string, offset int64, size int64, order string) (GetDepMemberListResp, error) + func (client *DingTalkClient) GetDepMemberIds(deptId string) (GetDepMemberIdsResp, error) + func (client *DingTalkClient) GetDepMemberList(deptId string, lang string, offset int64, size int64, order string) (GetDepMemberListResp, error) + func (client *DingTalkClient) GetDeptDetail(id string, lang *string) (GetDeptDetailResp, error) + func (client *DingTalkClient) GetDeptList(lang *string, fetchChild *bool, id string) (GetDeptListResp, error) + func (client *DingTalkClient) GetExtcontactDetail(userId string) (GetExtcontactDetailResp, error) + func (client *DingTalkClient) GetExtcontactList(size string, offset string) (GetExtcontactListResp, error) + func (client *DingTalkClient) GetJsApiTicket(authType string) (*GetJsApiTicketResp, error) + func (client *DingTalkClient) GetOrgUserCount(onlyActive int) (GetOrgUserCountResp, error) + func (client *DingTalkClient) GetProcessInstanceInfo(processInstanceId string) (GetProcessInstanceInfoResp, error) + func (client *DingTalkClient) GetRoleDetail(roleId int64) (GetRoleDetailResp, error) + func (client *DingTalkClient) GetRoleGroup(groupId int64) (GetRoleGroupResp, error) + func (client *DingTalkClient) GetRoleList(offset int, size int) (GetRoleListResp, error) + func (client *DingTalkClient) GetSubDept(id string) (GetSubdeptResp, error) + func (client *DingTalkClient) GetUserDetail(userId string, lang *string) (GetUserDetailResp, error) + func (client *DingTalkClient) GetUserIdByUnionId(unionId string) (GetUserIdByUnionIdResp, error) + func (client *DingTalkClient) GetUserInfoFromAdmin(code string) (GetUserInfoFromAdminResp, error) + func (client *DingTalkClient) GetUserInfoFromThird(code string) (GetUserInfoFromThirdResp, error) + func (client *DingTalkClient) GetUsersInRole(roleId int64, offset int, size int) (GetUsersInRoleResp, error) + func (client *DingTalkClient) GetWorkNoticeProgress(taskId int64) (GetWorkNoticeProgressResp, error) + func (client *DingTalkClient) GetWorkNoticeSendResult(taskId int64) (GetWorkNoticeResultResp, error) + func (client *DingTalkClient) GrantCustomSpace(domain string, grantType string, userId string, path string, fileIds string, ...) (*BaseResp, error) + func (client *DingTalkClient) ListLabelGroups(size string, offset string) (ListLabelGroupsResp, error) + func (client *DingTalkClient) ListParentDepts(userId string) (ListParentDeptsResp, error) + func (client *DingTalkClient) ListParentDeptsByDept(id string) (ListParentDeptsByDeptResp, error) + func (client *DingTalkClient) RecallWorkNotice(taskId int64) (WorkNoticeRecallResp, error) + func (client *DingTalkClient) SaveProcess(saveProcessRequest SaveProcessReq, fakeMode *bool, templateEditUrl *string) (SaveProcessResp, error) + func (client *DingTalkClient) SendDingPanFileToSingleChat(userId string, mediaId string, fileName string) (*BaseResp, error) + func (client *DingTalkClient) SendNormalNotice(sender string, cid string, msg WorkNoticeMsg) (SendNormalNoticeResp, error) + func (client *DingTalkClient) SendWorkNotice(userIdList *string, deptIdList *string, toAllUser bool, msg WorkNoticeMsg) (SendWorkNoticeResp, error) + func (client *DingTalkClient) UpdateWorkRecord(req UpdateWorkRecordRequest) (*BaseResp, error) + func (client *DingTalkClient) UpdateWorkRecordTask(req UpdateWorkRecordTaskRequest) (*CreateWorkRecordTaskResp, error) + func (client *DingTalkClient) UploadMedia(mediaType string, path string) (UploadMediaResp, error) + type DingTalkSDK struct + AesKey string + AppId int64 + SuiteKey string + SuiteSecret string + Token string + func NewSDK() *DingTalkSDK + func (s *DingTalkSDK) ActivateSuite(suiteAccessToken string, authCorpId string, permanentCode string) (*BaseResp, error) + func (s *DingTalkSDK) CreateCorp(corpId string, suiteTicket string) *Corp + func (s *DingTalkSDK) CreateCrypto() *Crypto + func (s *DingTalkSDK) GetPermanentCode(suiteAccessToken string, tmpAuthCode string) (*GetPermanentCodeResp, error) + func (s *DingTalkSDK) GetSuiteToken(suiteTicket string) (*GetSuiteAccessTokenResp, error) + func (s *DingTalkSDK) GetUserInfoByCode(code string) (GetUserInfoByCodeResp, error) + type ExtcontactDetail struct + Address string + CompanyName string + FollowerUserId string + LabelIds []int64 + Name string + Remark string + ShareDeptIds []int64 + ShareUserIds []string + StateCode string + Title string + UserId string + type FileNotice struct + MediaId string + type FileUploadSingleResp struct + MediaId string + type FormComponentList struct + ComponentName string + Props Props + type FormComponentPropVo struct + ActionName *string + Choice *int64 + Id string + Label string + Link *string + NotPrint *string + NotUpper *string + Options *[]string + Placeholder *string + Required *bool + StatField *[]FormComponentStatVo + Unit *string + type FormComponentStatVo struct + Id *string + Label *string + Unit *string + Upper *bool + type FormComponentValues struct + Name string + Value string + type FormComponentValuesVo struct + ExtValue string + Name string + Value string + type FormComponentVo struct + Children *FormComponentVo + ComponentName string + Props FormComponentPropVo + type FormConditionListResp struct + Result struct{ ... } + type GetAdminListResp struct + AdminList []AdminList + type GetAdminScopeResp struct + DeptIds []int64 + type GetAgentResp struct + AgentId int64 + Close int64 + Description string + LogoUrl string + Name string + type GetAuthInfoResp struct + AuthCorpInfo AuthCorpInfo + AuthInfo AuthInfo + AuthUserInfo AuthUserInfo + ChannelAuthInfo ChannelAuthInfo + type GetAuthScopesData struct + AuthedDept []int64 + AuthedUser []string + type GetAuthScopesResp struct + AuthOrgScopes GetAuthScopesData + AuthUserField []string + ConditionField []string + type GetCorpTokenResp struct + AccessToken string + ExpiresIn int64 + type GetCspaceInfoResp struct + Result struct{ ... } + Success bool + type GetCustomSpaceResp struct + SpaceId string + type GetDepMemberIdsResp struct + UserIds []string + type GetDepMemberListResp struct + HasMore bool + UserList []UserList + type GetDeptDetailResp struct + AutoAddUser bool + CreateDeptGroup bool + DeptHiding bool + DeptManagerUseridList string + DeptPermits string + Id int64 + Name string + Order int64 + OrgDeptOwner string + OuterDept bool + OuterPermitDepts string + OuterPermitUsers string + ParentId int64 + SourceIdentifier string + UserPermits string + type GetDeptListResp struct + Department []DepartmentInfo + type GetExtcontactDetailResp struct + Result ExtcontactDetail + type GetExtcontactListResp struct + Results []ExtcontactDetail + type GetJsApiTicketResp struct + ExpiresIn int64 + Ticket string + type GetOrgUserCountResp struct + Count int64 + type GetPermanentCodeResp struct + AuthCorpInfo AuthCorpInfo + PermanentCode string + type GetProcessInstanceInfoResp struct + ProcessInstance ProcessInstanceVo + type GetRoleDetailResp struct + Role Role + type GetRoleGroupResp struct + RoleGroup RoleGroupV1 + type GetRoleListResp struct + Result GetRoleListResult + type GetRoleListResult struct + HasMore bool + RoleList []RoleGroup + type GetSubdeptResp struct + SubDeptIdList []int64 + type GetSuiteAccessTokenResp struct + ExpiresIn int64 + SuiteAccessToken string + type GetUserDetailResp struct + type GetUserIdByUnionIdResp struct + ContactType int + UserId string + type GetUserInRoleResult struct + HasMore bool + NextCursor int64 + UserList []UserList + type GetUserInfoByCodeResp struct + UserInfo struct{ ... } + type GetUserInfoFromAdminResp struct + CropInfo struct{ ... } + IsSys bool + UserInfo struct{ ... } + type GetUserInfoFromThirdResp struct + DeviceId string + IsSys bool + SysLevel int64 + UserId string + type GetUsersInRoleResp struct + Result GetUserInRoleResult + type GetWorkNoticeProgressResp struct + Progress NoticeProgress + type GetWorkNoticeResultResp struct + SendResult NoticeSendResult + type ImageNotice struct + MediaId string + type Labels struct + Id int64 + Name string + type LinkNotice struct + MsgUrl string + PicUrl string + Text string + Title string + type ListLabelGroupsResp struct + Results []struct{ ... } + type ListParentDeptsByDeptResp struct + ParentIds []int64 + type ListParentDeptsResp struct + Department [][]int64 + type MarkdownNotice struct + Text string + Title string + type NoticeProgress struct + ProgressInPercent int64 + Status int64 + type NoticeSendResult struct + FailedUserIdList []string + ForbiddenUserIdList []string + InvalidDeptIdList []string + InvalidUserIdList []string + ReadUserIdList []string + UnreadUserIdList []string + type OANotice struct + Body OANoticeBody + Head OANoticeHead + MsgUrl string + type OANoticeBody struct + Author *string + Content *string + FileCount *string + Form *[]OANoticeBodyForm + Image *string + Rich *OANoticeBodyRich + Title *string + type OANoticeBodyForm struct + Key string + Value string + type OANoticeBodyRich struct + Num string + Unit string + type OANoticeHead struct + BgColor string + Text string + type OperationRecordsVo struct + Date string + OperationResult string + Remark string + UserId string + type ProcessInstanceApproverVo struct + TaskActionType *string + UserIds *[]string + type ProcessInstanceVo struct + AttachedProcessInstanceIds []string + BizAction string + BusinessId string + CcUserIds string + CreateTime string + FinishTime string + FormComponentValues []FormComponentValuesVo + OperationRecords []OperationRecordsVo + OriginatorDeptId string + OriginatorDeptName string + OriginatorUserId string + Result string + Status string + Tasks []TasksVo + Title string + type Props struct + Id string + Label string + Placeholder string + Required bool + Unit string + type Role struct + Id int64 + Name string + type RoleGroup struct + GroupId int64 + Name string + Roles []Role + type RoleGroupV1 struct + Name string + Roles []RoleV1 + type RoleV1 struct + Id int64 + Name string + type SaveProcessReq struct + AgentId int64 + Description string + DisableFormEdit *string + FormComponentList []FormComponentVo + Name string + ProcessCode *string + type SaveProcessRequest struct + AgentId int64 + Description string + FakeMode bool + FormComponentList []FormComponentList + Name string + ProcessCode string + type SaveProcessResp struct + Result struct{ ... } + type SendNormalNoticeResp struct + Receiver string + type SendWorkNoticeResp struct + TaskId int64 + type TasksVo struct + CreateTime string + FinishTime string + TaskId string + TaskResult string + TaskStatus string + UserId string + type TextNotice struct + Content string + type UpdateWorkRecordRequest struct + AgentId int64 + ProcessInstanceId string + Result string + Status string + type UpdateWorkRecordTaskRequest struct + AgentId int64 + ProcessInstanceId string + Tasks []UpdateWorkRecordTaskTop + type UpdateWorkRecordTaskResp struct + type UpdateWorkRecordTaskTop struct + Result string + Status string + TaskId int64 + type UploadMediaResp struct + CreatedAt int64 + MediaId string + Type string + type UserDetailRole struct + GroupName string + Id int64 + Name string + type UserList struct + Active bool + Avatar string + Department []int64 + DingId string + HiredDate int64 + IsAdmin bool + IsBoos bool + IsHide bool + IsLeaderInDepts string + IsSenior bool + JobNumber string + Name string + OrderInDepts string + Position string + Roles []UserDetailRole + UnionId string + UserId string + type VoiceNotice struct + Duration string + MediaId string + type WorkNoticeMsg struct + ActionCard *ActionCardNotice + File *FileNotice + Image *ImageNotice + Link *LinkNotice + Markdown *MarkdownNotice + MsgType string + OA *OANotice + Text *TextNotice + Voice *VoiceNotice + type WorkNoticeRecallResp struct