dingtalk

package
v0.0.0-...-1911912 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AES_ENCODE_KEY_LENGTH = 43
)

Variables

View Source
var Token = &AccessToken{}

Functions

func DepartmentDetail

func DepartmentDetail(id, wt int) *models.Department

获取部门详情

func DepartmentUserDetail

func DepartmentUserDetail(id, pageNum, wt int) *[]models.User

获取部门用户详情

func DepartmentUserIdsDetail

func DepartmentUserIdsDetail(id, wt int) []string

获取部门用户userid列表

func DevCkTaskDingding

func DevCkTaskDingding(devcktodd *models.Devcktodd) string

生成设备自我盘点任务信息通知消息体

func DeviceDingding

func DeviceDingding(todo *models.DevtodoResp) string

生成设备机构变更&交回信息通知消息体

func GetAccessToken

func GetAccessToken() string

func GetEappAccessToken

func GetEappAccessToken() string

小程序Token(用于发送工作通知)

func GetJsApiConfig

func GetJsApiConfig(url string) string

func GetUserId

func GetUserId(code string) string

func GetYdksAccessToken

func GetYdksAccessToken() string

获取 ydks 项目 AccessToken

func MseesageToDingding

func MseesageToDingding(msg *models.Msg) string

生成工作通知消息体

func NoteMseesageToDingding

func NoteMseesageToDingding(p *models.Note) string

生成记事本通知消息体

func OndutyMseesageToDingding

func OndutyMseesageToDingding(p *models.Onduty) string

生成值班通知消息体

func OrgUserCount

func OrgUserCount(wt int) (int, error)

获取企业员工人数

func ProcessBcmsMseesageToDingding

func ProcessBcmsMseesageToDingding(p *models.ProcResponse) string

生成流程提报补充描述通知消息体

func ProcessMseesageToDingding

func ProcessMseesageToDingding(p *models.ProcResponse, czr string) string

生成流程提报待办通知消息体

func RegCallbackInit

func RegCallbackInit()

main方法启动时注册回调接口

func Sha1Sign

func Sha1Sign(s string) string

func SubDepartmentList

func SubDepartmentList(wt int) ([]int, error)

获取子部门Id列表

func UpDeviceDingding

func UpDeviceDingding(num int, jgmc, gly string) string

生成上交设备信息通知消息体

func UserDetail

func UserDetail(userid string, wt int) *models.User

获取用户详情

Types

type AccessToken

type AccessToken struct {
	AccessToken string `json:"access_token"`
	ExpiresTime int64  `json:"expires_time"`
}

type AsyncsendResponse

type AsyncsendResponse struct {
	OpenAPIResponse
	TaskId int `json:"task_id"`
}

会话消息异步发送

func EappMessageCorpconversationAsyncsend

func EappMessageCorpconversationAsyncsend(mpar string) *AsyncsendResponse

企业会话消息异步发送

func MessageCorpconversationAsyncsend

func MessageCorpconversationAsyncsend(mpar string) *AsyncsendResponse

企业会话消息异步发送

type CallBackResponse

type CallBackResponse struct {
	OpenAPIResponse
}

回调事件Models

func DeleteCallback

func DeleteCallback() (*CallBackResponse, error)

删除事件回调接口

func RegisterCallback

func RegisterCallback(request map[string]interface{}) (*CallBackResponse, error)

注册事件回调接口

func UpdateCallback

func UpdateCallback(request map[string]interface{}) (*CallBackResponse, error)

更新事件回调接口

type DingTalkCrypto

type DingTalkCrypto struct {
	Token          string
	EncodingAESKey string
	SuiteKey       string
	BKey           []byte
	Block          cipher.Block
}

func NewDingTalkCrypto

func NewDingTalkCrypto(token, encodingAESKey, suiteKey string) *DingTalkCrypto

func (*DingTalkCrypto) CreateSignature

func (c *DingTalkCrypto) CreateSignature(token, timeStamp, nonce, secretStr string) string

数据签名

func (*DingTalkCrypto) GetDecryptMsg

func (c *DingTalkCrypto) GetDecryptMsg(signature, timestamp, nonce, secretMsg string) (string, error)

func (*DingTalkCrypto) GetEncryptMsg

func (c *DingTalkCrypto) GetEncryptMsg(replyMsg, timestamp, nonce string) (string, string, error)

func (*DingTalkCrypto) VerificationSignature

func (c *DingTalkCrypto) VerificationSignature(token, timestamp, nonce, msg, sigture string) bool

校验数据签名

type FailedCallbacks

type FailedCallbacks struct {
	EventTime   int      `json:"event_time"`
	CallbackTag string   `json:"call_back_tag"`
	UserID      []string `json:"userid"`
	CorpID      string   `json:"corpid"`
}

type FormItemList

type FormItemList struct {
	Title   string `json:"title"`   //表单标题
	Content string `json:"content"` //表单内容
}

待办任务Models

type GetFailedCallbackResponse

type GetFailedCallbackResponse struct {
	OpenAPIResponse
	HasMore    bool              `json:"has_more"`
	FailedList []FailedCallbacks `json:"failed_list"`
}

func GetFailedCallbacks

func GetFailedCallbacks() (*GetFailedCallbackResponse, error)

获取回调失败的结果

type OpenAPIResponse

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

type QueryCallbackResponse

type QueryCallbackResponse struct {
	OpenAPIResponse
	CallbackTag []string `json:"call_back_tag"`
	Token       string   `json:"token"`
	AesKey      string   `json:"aes_key"`
	URL         string   `json:"url"`
}

func QueryCallback

func QueryCallback() (*QueryCallbackResponse, error)

查询事件回调接口

type UserInfo

type UserInfo struct {
	UserID     string `json:"userid"`
	Name       string `json:"name"`
	Avatar     string `json:"avatar"`
	Department []int  `json:"department"`
	Mobile     string `json:"mobile"`
}

func GetUserInfo

func GetUserInfo(userId string) *UserInfo

type WorkrecordAddRequest

type WorkrecordAddRequest struct {
	UserID       string         `json:"userid"`
	CreateTime   int64          `json:"create_time"`  //待办事项发起时间
	Title        string         `json:"title"`        //待办标题
	Url          string         `json:"url"`          //待办事项的跳转链接
	PcUrl        string         `json:"pcUrl"`        //pc端跳转url,不传则使用url参数
	FormItemList []FormItemList `json:"formItemList"` //待办事项表单

}

type WorkrecordAddResponse

type WorkrecordAddResponse struct {
	OpenAPIResponse
	RecordId string `json:"record_id"`
}

func WorkrecordAdd

func WorkrecordAdd(userid, workrecordTitle, title, content string) (*WorkrecordAddResponse, error)

创建待办任务

func YdksWorkrecordAdd

func YdksWorkrecordAdd(reqJson string) (*WorkrecordAddResponse, error)

创建待办任务

type WorkrecordList

type WorkrecordList struct {
	RecordId   string         `json:"record_id"`   //待办事项id,可用此id调用更新待办的接口
	CreateTime int64          `json:"create_time"` //待办事项发起时间
	Title      string         `json:"title"`       //待办标题
	Url        string         `json:"url"`         //待办事项的跳转链接
	Forms      []FormItemList `json:"forms"`       //待办表单列表
}

type WorkrecordQueryRequest

type WorkrecordQueryRequest struct {
	UserID string `json:"userid"`
	Offset int    `json:"offset"` //分页游标,从0开始,如返回结果中has_more为true,则表示还有数据,offset再传上一次的offset+limit
	Limit  int    `json:"limit"`  //分页大小,最多50
	Status int    `json:"status"` //待办事项状态,0表示未完成,1表示完成
}

type WorkrecordQueryResponse

type WorkrecordQueryResponse struct {
	OpenAPIResponse
	Records WorkrecordRecord `json:"records"`
}

func WorkrecordQuery

func WorkrecordQuery(userid string, offset, limit, status int) (*WorkrecordQueryResponse, error)

分页获取用户的待办任务列表

type WorkrecordRecord

type WorkrecordRecord struct {
	HasMore bool             `json:"has_more"` //true表示还有多余的数据
	List    []WorkrecordList `json:"list"`
}

type WorkrecordUpdateRequest

type WorkrecordUpdateRequest struct {
	UserID   string `json:"userid"`
	RecordId string `json:"record_id"`
}

type WorkrecordUpdateResponse

type WorkrecordUpdateResponse struct {
	OpenAPIResponse
	Result bool `json:"result"`
}

func WorkrecordUpdate

func WorkrecordUpdate(userid, record_id string) (*WorkrecordUpdateResponse, error)

更新任务状态

func YdksWorkrecordUpdate

func YdksWorkrecordUpdate(userid, record_id string) (*WorkrecordUpdateResponse, error)

更新任务状态

Jump to

Keyboard shortcuts

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