Documentation ¶
Index ¶
- Constants
- func GetLarkClientByIMAppID(id string) (*lark.Client, error)
- func GetLarkUserID(approvalID, queryType, queryValue string) (string, error)
- func GetNodeUserApprovalResults(instanceID, nodeID string) map[string]*UserApprovalResult
- func RemoveLarkApprovalInstanceManager(instanceID string)
- func UpdateNodeUserApprovalResult(instanceID, nodeKey, nodeID, userID string, result *UserApprovalResult)
- type ApprovalInstanceEvent
- type ApprovalManager
- type ApprovalManagerMap
- type ApprovalTaskEvent
- type CallbackData
- type DepartmentInfo
- type EventHandlerResponse
- type NodeUserApprovalResult
- type UserApprovalResult
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 GetLarkUserID ¶
func GetNodeUserApprovalResults ¶
func GetNodeUserApprovalResults(instanceID, nodeID string) map[string]*UserApprovalResult
func RemoveLarkApprovalInstanceManager ¶
func RemoveLarkApprovalInstanceManager(instanceID string)
func UpdateNodeUserApprovalResult ¶
func UpdateNodeUserApprovalResult(instanceID, nodeKey, nodeID, userID string, result *UserApprovalResult)
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 { // key nodeID NodeMap NodeUserApprovalResult NodeKeyMap map[string]string RequestUUID map[string]struct{} }
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
type ApprovalManagerMap ¶
type ApprovalManagerMap struct { }
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 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 }
Click to show internal directories.
Click to hide internal directories.