dingtalk

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: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 (
	AND  = "AND"
	OR   = "OR"
	NONE = "NONE"
)
View Source
const (
	DefaultApprovalFormName = "Zadig 审批表单模板"
)

Variables

View Source
var (
	ErrApprovalFormNameExists = errors.New("approval form name already exists")
)

Functions

func Validate

func Validate(ak, sk string) error

Types

type ApprovalAction

type ApprovalAction string

type ApprovalForm

type ApprovalForm struct {
	Name        string `json:"name"`
	URL         string `json:"url"`
	IconURL     string `json:"iconUrl"`
	ProcessCode string `json:"processCode"`
}

type ApprovalFormDefinition

type ApprovalFormDefinition struct {
	ProcessCode    string           `json:"processCode"`
	Name           string           `json:"name"`
	Description    string           `json:"description"`
	FormComponents []FormComponents `json:"formComponents"`
	TemplateConfig *TemplateConfig  `json:"templateConfig"`
}

type ApprovalInstance

type ApprovalInstance struct {
	ProcessCode         string               `json:"processCode"`
	Originator          string               `json:"originatorUserId"`
	Approvers           []*ApprovalNode      `json:"approvers"`
	FormComponentValues []FormComponentValue `json:"formComponentValues"`
	MicroAgentID        int                  `json:"microappAgentId,omitempty"`
}

type ApprovalInstanceInfo

type ApprovalInstanceInfo struct {
	Title            string                  `json:"title"`
	Status           string                  `json:"status"`
	Result           string                  `json:"result"`
	OperationRecords []*OperationRecord      `json:"operationRecords"`
	Tasks            []*ApprovalInstanceTask `json:"tasks"`
}

type ApprovalInstanceTask

type ApprovalInstanceTask struct {
	UserID     string `json:"userid"`
	Result     string `json:"result"`
	ActivityID string `json:"activityId"`
}

type ApprovalNode

type ApprovalNode struct {
	ActionType ApprovalAction `json:"actionType"`
	UserIDs    []string       `json:"userIds"`
}

type Client

type Client struct {
	*req.Client
	AppKey    string
	AppSecret string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(key, secret string) (client *Client)

func (*Client) CreateApproval

func (c *Client) CreateApproval() (resp *CreateApprovalResponse, err error)

func (*Client) CreateApprovalInstance

func (c *Client) CreateApprovalInstance(args *CreateApprovalInstanceArgs) (resp *CreateApprovalInstanceResponse, err error)

func (*Client) GetAllApprovalFormDefinitionList

func (c *Client) GetAllApprovalFormDefinitionList() (resp []ApprovalForm, err error)

func (*Client) GetApprovalFormDefinitionList

func (c *Client) GetApprovalFormDefinitionList(next int) (resp *GetAllApprovalFormDefinitionResponse, err error)

func (*Client) GetApprovalInstance

func (c *Client) GetApprovalInstance(id string) (resp *ApprovalInstanceInfo, err error)

func (*Client) GetDepartmentUserIDs

func (c *Client) GetDepartmentUserIDs(id int) (resp *GetDepartmentUserIDResponse, err error)

func (*Client) GetSubDepartmentsInfo

func (c *Client) GetSubDepartmentsInfo(id int) (resp []SubDepartmentInfo, err error)

func (*Client) GetUserIDByMobile

func (c *Client) GetUserIDByMobile(mobile string) (resp *UserIDResponse, err error)

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(id string) (resp *UserInfo, err error)

func (*Client) GetUserInfos

func (c *Client) GetUserInfos(ids []string) ([]*UserInfo, error)

func (*Client) RefreshAccessToken

func (c *Client) RefreshAccessToken() (string, error)

type CreateApprovalInstanceArgs

type CreateApprovalInstanceArgs struct {
	ProcessCode      string
	OriginatorUserID string
	ApproverNodeList []*ApprovalNode
	FormContent      string
}

type CreateApprovalInstanceResponse

type CreateApprovalInstanceResponse struct {
	InstanceID string `json:"instanceId"`
}

type CreateApprovalResponse

type CreateApprovalResponse struct {
	ProcessCode string `json:"processCode"`
}

type FormComponentValue

type FormComponentValue struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type FormComponents

type FormComponents struct {
	ComponentType string `json:"componentType"`
	Props         Props  `json:"props,omitempty"`
}

type GetAllApprovalFormDefinitionResponse

type GetAllApprovalFormDefinitionResponse struct {
	ProcessList []ApprovalForm `json:"processList"`
	NextToken   int            `json:"nextToken"`
}

type GetDepartmentUserIDResponse

type GetDepartmentUserIDResponse struct {
	UserIDList []string `json:"userid_list"`
}

type OperationRecord

type OperationRecord struct {
	UserID string `json:"userid"`
	Date   string `json:"date"`
	Result string `json:"result"`
	Remark string `json:"remark"`
}

type Props

type Props struct {
	Label       string `json:"label"`
	Placeholder string `json:"placeholder"`
	ComponentID string `json:"componentId"`
	Required    bool   `json:"required"`
}

type SubDepartmentInfo

type SubDepartmentInfo struct {
	ID   int64  `json:"dept_id"`
	Name string `json:"name"`
}

type TemplateConfig

type TemplateConfig struct {
	DisableFormEdit bool `json:"disableFormEdit"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"accessToken"`
	ExpireIn    int    `json:"expireIn"`
}

type UserIDResponse

type UserIDResponse struct {
	UserID string `json:"userid"`
}

type UserInfo

type UserInfo struct {
	UserID           string `json:"userid"`
	UnionID          string `json:"unionid"`
	Name             string `json:"name"`
	Avatar           string `json:"avatar"`
	StateCode        string `json:"state_code"`
	ManegerUserID    string `json:"manager_userid"`
	Mobile           string `json:"mobile"`
	Telephone        string `json:"telephone"`
	JobNumber        string `json:"job_number"`
	Title            string `json:"title"`
	Email            string `json:"email"`
	ExclusiveAccount bool   `json:"exclusive_account"`
}

Jump to

Keyboard shortcuts

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