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
- Variables
- func Validate(ak, sk string) error
- type ApprovalAction
- type ApprovalForm
- type ApprovalFormDefinition
- type ApprovalInstance
- type ApprovalInstanceInfo
- type ApprovalInstanceTask
- type ApprovalNode
- type Client
- func (c *Client) CreateApproval() (resp *CreateApprovalResponse, err error)
- func (c *Client) CreateApprovalInstance(args *CreateApprovalInstanceArgs) (resp *CreateApprovalInstanceResponse, err error)
- func (c *Client) GetAllApprovalFormDefinitionList() (resp []ApprovalForm, err error)
- func (c *Client) GetApprovalFormDefinitionList(next int) (resp *GetAllApprovalFormDefinitionResponse, err error)
- func (c *Client) GetApprovalInstance(id string) (resp *ApprovalInstanceInfo, err error)
- func (c *Client) GetDepartmentUserIDs(id int) (resp *GetDepartmentUserIDResponse, err error)
- func (c *Client) GetSubDepartmentsInfo(id int) (resp []SubDepartmentInfo, err error)
- func (c *Client) GetUserIDByMobile(mobile string) (resp *UserIDResponse, err error)
- func (c *Client) GetUserInfo(id string) (resp *UserInfo, err error)
- func (c *Client) GetUserInfos(ids []string) ([]*UserInfo, error)
- func (c *Client) RefreshAccessToken() (string, error)
- type CreateApprovalInstanceArgs
- type CreateApprovalInstanceResponse
- type CreateApprovalResponse
- type FormComponentValue
- type FormComponents
- type GetAllApprovalFormDefinitionResponse
- type GetDepartmentUserIDResponse
- type OperationRecord
- type Props
- type SubDepartmentInfo
- type TemplateConfig
- type TokenResponse
- type UserIDResponse
- type UserInfo
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 ¶
Types ¶
type ApprovalAction ¶
type ApprovalAction string
type ApprovalForm ¶
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 ApprovalNode ¶
type ApprovalNode struct {
ActionType ApprovalAction `json:"actionType"`
UserIDs []string `json:"userIds"`
}
type 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) RefreshAccessToken ¶
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 FormComponents ¶
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 SubDepartmentInfo ¶
type TemplateConfig ¶
type TemplateConfig struct {
DisableFormEdit bool `json:"disableFormEdit"`
}
type TokenResponse ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.