lark

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ApprovalStatusNotFound not defined by lark open api, it just means not found in local manager.
	ApprovalStatusNotFound = "NOTFOUND"

	ApprovalStatusPending  = "PENDING"
	ApprovalStatusApproved = "APPROVED"
	ApprovalStatusRejected = "REJECTED"
	ApprovalStatusCanceled = "CANCELED"
	ApprovalStatusDeleted  = "DELETED"
)

Variables

This section is empty.

Functions

func GetLarkClientByIMAppID

func GetLarkClientByIMAppID(id string) (*lark.Client, error)

func GetLarkUserID

func GetLarkUserID(approvalID, queryType, queryValue string) (string, error)

func RemoveLarkApprovalInstanceManager

func RemoveLarkApprovalInstanceManager(instanceID string)

Types

type ApprovalInstanceEvent

type ApprovalInstanceEvent struct {
	AppID               string `json:"app_id"`
	ApprovalCode        string `json:"approval_code"`
	InstanceCode        string `json:"instance_code"`
	InstanceOperateTime string `json:"instance_operate_time"`
	OperateTime         string `json:"operate_time"`
	Status              string `json:"status"`
	TenantKey           string `json:"tenant_key"`
	Type                string `json:"type"`
	UUID                string `json:"uuid"`
}

type ApprovalManager

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

func GetLarkApprovalInstanceManager

func GetLarkApprovalInstanceManager(instanceID string) *ApprovalManager

func (*ApprovalManager) CheckAndUpdateUUID

func (l *ApprovalManager) CheckAndUpdateUUID(uuid string) bool

func (*ApprovalManager) GetNodeKeyMap

func (l *ApprovalManager) GetNodeKeyMap() map[string]string

func (*ApprovalManager) GetNodeUserApprovalResults

func (l *ApprovalManager) GetNodeUserApprovalResults(nodeID string) map[string]*UserApprovalResult

func (*ApprovalManager) UpdateNodeKeyMap

func (l *ApprovalManager) UpdateNodeKeyMap(nodeKey, nodeCustomKey string)

func (*ApprovalManager) UpdateNodeUserApprovalResult

func (l *ApprovalManager) UpdateNodeUserApprovalResult(nodeID, userID string, result *UserApprovalResult)

type ApprovalManagerMap

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

type ApprovalTaskEvent

type ApprovalTaskEvent struct {
	AppID        string `json:"app_id"`
	OpenID       string `json:"open_id"`
	TenantKey    string `json:"tenant_key"`
	Type         string `json:"type"`
	ApprovalCode string `json:"approval_code"`
	InstanceCode string `json:"instance_code"`
	TaskID       string `json:"task_id"`
	UserID       string `json:"user_id"`
	Status       string `json:"status"`
	OperateTime  string `json:"operate_time"`
	CustomKey    string `json:"custom_key"`
	DefKey       string `json:"def_key"`
	Extra        string `json:"extra"`
}

type CallbackData

type CallbackData struct {
	UUID  string          `json:"uuid"`
	Event json.RawMessage `json:"event"`
	Token string          `json:"token"`
	Ts    string          `json:"ts"`
	Type  string          `json:"type"`
}

type DepartmentInfo

type DepartmentInfo struct {
	UserList          []*lark.UserInfo       `json:"user_list"`
	SubDepartmentList []*lark.DepartmentInfo `json:"sub_department_list"`
}

func GetLarkAppContactRange

func GetLarkAppContactRange(approvalID string) (*DepartmentInfo, error)

func GetLarkDepartment

func GetLarkDepartment(approvalID, openID string) (*DepartmentInfo, error)

type EventHandlerResponse

type EventHandlerResponse struct {
	Challenge string `json:"challenge"`
}

func EventHandler

func EventHandler(appID, sign, ts, nonce, body string) (*EventHandlerResponse, error)

type NodeUserApprovalResult

type NodeUserApprovalResult map[string]map[string]*UserApprovalResult

type UserApprovalResult

type UserApprovalResult struct {
	Result          string
	ApproveOrReject config.ApproveOrReject
	OperationTime   int64
}

Jump to

Keyboard shortcuts

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