2026-05-12 13:34:28 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"ai-agent/workflow/consts/flow"
|
|
|
|
|
|
"ai-agent/workflow/consts/node"
|
|
|
|
|
|
|
2026-06-11 09:16:53 +08:00
|
|
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
2026-05-12 13:34:28 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type FlowInfo struct {
|
|
|
|
|
|
Version string `json:"version"`
|
|
|
|
|
|
StartNodeId string `json:"startNodeId"`
|
|
|
|
|
|
Nodes []FlowNode `json:"nodes"`
|
|
|
|
|
|
Edges []FlowEdge `json:"edges"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type FlowNode struct {
|
2026-06-10 14:23:55 +08:00
|
|
|
|
Id string `json:"id"`
|
|
|
|
|
|
NodeCode node.NodeType `json:"nodeCode"`
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
Config map[string]interface{} `json:"config"`
|
|
|
|
|
|
SkillName string `json:"skillName"`
|
|
|
|
|
|
PromptContent string `json:"promptContent"`
|
|
|
|
|
|
IsSaveFile bool `json:"isSaveFile"`
|
|
|
|
|
|
InputSource []FlowNodeInputSource `json:"inputSource"` // 前端指定:来源节点ID
|
|
|
|
|
|
FormConfig []node.NodeFormField `json:"formConfig"`
|
|
|
|
|
|
ModelConfig node.ModelItem `json:"modelConfig"`
|
|
|
|
|
|
OutputConfig []node.NodeFormField `json:"outputConfig"`
|
|
|
|
|
|
OutputResult []node.NodeFormField `json:"outputResult" ds:"节点输出结果"`
|
2026-05-12 13:34:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type FlowNodeInputSource struct {
|
|
|
|
|
|
NodeId string `json:"nodeId"`
|
|
|
|
|
|
QuoteOutput bool `json:"quoteOutput"`
|
|
|
|
|
|
Field []string `json:"field"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type FlowEdge struct {
|
|
|
|
|
|
Id string `json:"id"`
|
|
|
|
|
|
From string `json:"from"`
|
|
|
|
|
|
To string `json:"to"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type FlowUser struct {
|
|
|
|
|
|
beans.SQLBaseDO `orm:",inherit"` // 嵌入基础字段:Id, TenantId, Creator, CreatedAt, Updater, UpdatedAt, DeletedAt
|
|
|
|
|
|
// 业务字段
|
|
|
|
|
|
FlowName string `orm:"flow_name" json:"flowName" description:"流程名称"`
|
|
|
|
|
|
Description string `orm:"description" json:"description" description:"流程描述"`
|
|
|
|
|
|
FlowContent *FlowInfo `orm:"flow_content" json:"flowContent" description:"流程内容"`
|
|
|
|
|
|
NodeInputParams []*FlowNode `orm:"node_input_params" json:"nodeInputParams" description:"节点输入参数"`
|
|
|
|
|
|
AccessLevel flow.FlowUserAccessLevel `orm:"access_level" json:"accessLevel" description:"访问权限:1私有,2团队,3公开"`
|
|
|
|
|
|
SourceFlowTemplateId int64 `orm:"source_flow_template_id" json:"sourceFlowTemplateId" description:"来源流程模板ID"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type flowUserCol struct {
|
|
|
|
|
|
beans.SQLBaseCol
|
|
|
|
|
|
FlowName string
|
|
|
|
|
|
Description string
|
|
|
|
|
|
FlowContent string
|
|
|
|
|
|
NodeInputParams string
|
|
|
|
|
|
AccessLevel string
|
|
|
|
|
|
SourceFlowTemplateId string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var FlowUserCol = flowUserCol{
|
|
|
|
|
|
SQLBaseCol: beans.DefSQLBaseCol,
|
|
|
|
|
|
FlowName: "flow_name",
|
|
|
|
|
|
Description: "description",
|
|
|
|
|
|
FlowContent: "flow_content",
|
|
|
|
|
|
NodeInputParams: "node_input_params",
|
|
|
|
|
|
AccessLevel: "access_level",
|
|
|
|
|
|
SourceFlowTemplateId: "source_flow_template_id",
|
|
|
|
|
|
}
|