domain

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel string
const (
	ChannelLarkCard Channel = "FEISHU_CARD" // 飞书卡片
)

type Field added in v1.10.0

type Field struct {
	IsShort bool   `json:"is_short"`
	Tag     string `json:"tag"`
	Content string `json:"content"`
}

type FieldType added in v1.10.0

type FieldType string
const (
	// FieldInput 单行文本
	FieldInput FieldType = "input"
	// FieldTextarea 多行文本
	FieldTextarea FieldType = "textarea"
	// FieldNumber 数字
	FieldNumber FieldType = "number"
	// FieldDate 日期
	FieldDate FieldType = "date"
	// FieldSelect 下拉选择
	FieldSelect FieldType = "select"
	// FieldMultiSelect 多项选择
	FieldMultiSelect FieldType = "multi_select"
)

type InputField added in v1.10.0

type InputField struct {
	Name     string            `json:"name"`     // 表单字段显示名
	Key      string            `json:"key"`      // 表单字段键名(对应 Order Data Key)
	Type     FieldType         `json:"type"`     // 字段类型:input, textarea, date, number...
	Required bool              `json:"required"` // 是否必填
	Options  []InputOption     `json:"options"`  // 选项列表(用于 select 等)
	Props    map[string]string `json:"props"`    // 额外组件属性(如 placeholder)
}

type InputOption added in v1.10.0

type InputOption struct {
	Label string `json:"label"` // 选项显示名
	Value string `json:"value"` // 选项值
}

type NodeName

type NodeName string
const (
	Start      NodeName = "START"      // 开始节点
	Automation NodeName = "AUTOMATION" // 自动化节点
	User       NodeName = "USER"       // 用户审批节点
)

type Notification

type Notification struct {
	Receiver string   `json:"receiver"` // 接收者(手机/邮箱/用户ID)
	Template Template `json:"template"` // 发送模版
	Channel  Channel  `json:"channel"`  // 发送渠道
}

type NotificationResponse added in v1.10.0

type NotificationResponse struct {
	// 通知平台生成的通知ID
	NotificationId int64 `json:"notification_Id"`
	// 发送状态
	Status string `json:"status"`
	// 失败时的错误代码
	ErrorCode string `json:"error_code"`
	// 错误详情
	ErrorMsg string `json:"error_msg"`
}

func NewErrorResponse added in v1.10.0

func NewErrorResponse(errorCode, errorMsg string) NotificationResponse

NewErrorResponse 创建错误响应

func NewErrorResponseWithID added in v1.10.0

func NewErrorResponseWithID(notificationId int64, status, errorCode, errorMsg string) NotificationResponse

NewErrorResponseWithID 创建带通知ID的错误响应

func NewSuccessResponse added in v1.10.0

func NewSuccessResponse(notificationId int64, status string) NotificationResponse

NewSuccessResponse 创建成功响应

type StrategyInfo

type StrategyInfo struct {
	NodeName    NodeName          `json:"node_name"`    // 节点名称
	OrderInfo   order.Order       `json:"order_info"`   // 工单提交信息
	WfInfo      workflow.Workflow `json:"wf_info"`      // 流程信息
	InstanceId  int               `json:"instance_id"`  // 实例 id
	CurrentNode *model.Node       `json:"current_node"` // 流程当前节点
}

type Template

type Template struct {
	Name        string       `json:"name"`         // 模版名称
	Title       string       `json:"title"`        // 模版标题
	Fields      []Field      `json:"fields"`       // 模版字段信息
	Values      []Value      `json:"values"`       // 模版传递变量
	InputFields []InputField `json:"input_fields"` // 录入的字段
	HideForm    bool         `json:"hide_form"`    // 隐藏
}

type Value added in v1.10.0

type Value struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

Jump to

Keyboard shortcuts

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