dingtalk

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

* Copyright 2023 The KodeRover Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	EventTaskChange     = "bpms_task_change"
	EventInstanceChange = "bpms_instance_change"
)

Variables

This section is empty.

Functions

func GetDingTalkClientByIMAppID

func GetDingTalkClientByIMAppID(id string) (*dingtalk.Client, error)

func GetDingTalkUserIDByMobile

func GetDingTalkUserIDByMobile(id, mobile string) (string, error)

func RemoveDingTalkApprovalManager

func RemoveDingTalkApprovalManager(instanceID string)

Types

type ApprovalManager

type ApprovalManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func GetDingTalkApprovalManager

func GetDingTalkApprovalManager(instanceID string) *ApprovalManager

func (*ApprovalManager) GetAllUserApprovalResults

func (l *ApprovalManager) GetAllUserApprovalResults() map[string]*UserApprovalResult

func (*ApprovalManager) SetUserApprovalResult

func (l *ApprovalManager) SetUserApprovalResult(userID, result, remark string, time int64)

type ApprovalManagerMap

type ApprovalManagerMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type DepartmentInfo

type DepartmentInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

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, error)

func (*DingTalkCrypto) CreateSignature

func (c *DingTalkCrypto) CreateSignature(token, timestamp, nonce, msg string) string

func (*DingTalkCrypto) GetDecryptMsg

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

func (*DingTalkCrypto) GetEncryptMsg

func (c *DingTalkCrypto) GetEncryptMsg(msg string) (map[string]string, error)

func (*DingTalkCrypto) GetEncryptMsgDetail

func (c *DingTalkCrypto) GetEncryptMsgDetail(msg, timestamp, nonce string) (string, string, error)

func (*DingTalkCrypto) VerificationSignature

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

type EventInstanceChangeData

type EventInstanceChangeData struct {
	EventType         string `json:"EventType"`
	ProcessInstanceID string `json:"processInstanceId"`
	FinishTime        int64  `json:"finishTime"`
	CorpID            string `json:"corpId"`
	Title             string `json:"title"`
	Type              string `json:"type"`
	URL               string `json:"url"`
	Result            string `json:"result"`
	CreateTime        int64  `json:"createTime"`
	StaffID           string `json:"staffId"`
	ProcessCode       string `json:"processCode"`
}

type EventResponse

type EventResponse struct {
	MsgSignature string `json:"msg_signature"`
	TimeStamp    string `json:"timeStamp"`
	Nonce        string `json:"nonce"`
	Encrypt      string `json:"encrypt"`
}

func EventHandler

func EventHandler(appKey string, body []byte, signature, ts, nonce string) (*EventResponse, error)

type EventTaskChangeData

type EventTaskChangeData struct {
	EventType         string `json:"EventType"`
	ProcessInstanceID string `json:"processInstanceId"`
	FinishTime        int64  `json:"finishTime"`
	CorpID            string `json:"corpId"`
	Title             string `json:"title"`
	Type              string `json:"type"`
	Result            string `json:"result"`
	Remark            string `json:"remark"`
	CreateTime        int64  `json:"createTime"`
	StaffID           string `json:"staffId"`
	ProcessCode       string `json:"processCode"`
}

type SubDepartmentAndUserIDsResponse

type SubDepartmentAndUserIDsResponse struct {
	SubDepartmentIDs []*DepartmentInfo `json:"sub_department_list"`
	Users            []*UserInfo       `json:"user_list"`
}

func GetDingTalkDepartment

func GetDingTalkDepartment(id, departmentID string) (*SubDepartmentAndUserIDsResponse, error)

type UserApprovalResult

type UserApprovalResult struct {
	Result        string
	OperationTime int64
	Remark        string
}

type UserInfo

type UserInfo struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

Jump to

Keyboard shortcuts

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