2026-05-12 13:34:28 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"ai-agent/workflow/consts/flow"
|
|
|
|
|
|
|
2026-06-10 15:29:21 +08:00
|
|
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
2026-05-12 13:34:28 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type FlowExecution struct {
|
|
|
|
|
|
beans.SQLBaseDO `orm:",inherit"` // 嵌入基础字段:Id, TenantId, Creator, CreatedAt, Updater, UpdatedAt, DeletedAt
|
|
|
|
|
|
// 业务字段
|
|
|
|
|
|
FlowUserId int64 `orm:"flow_user_id" json:"flowUserId" description:"流程ID"`
|
|
|
|
|
|
FlowName string `orm:"flow_name" json:"flowName" description:"流程名称"`
|
|
|
|
|
|
TriggerType flow.FlowExecutionTriggerType `orm:"trigger_type" json:"triggerType" description:"触发类型"`
|
|
|
|
|
|
DurationMs int64 `orm:"duration_ms" json:"durationMs" description:"执行时长(毫秒)"`
|
|
|
|
|
|
Status flow.FlowExecutionStatus `orm:"status" json:"status" description:"状态:1-运行中,2-成功,3-失败"`
|
|
|
|
|
|
FlowContent *FlowInfo `orm:"flow_content" json:"flowContent" description:"流程内容"`
|
|
|
|
|
|
NodeInputParams []*FlowNode `orm:"node_input_params" json:"nodeInputParams" description:"节点输入参数"`
|
|
|
|
|
|
OutputParams []map[string]interface{} `orm:"output_params" json:"outputParams" description:"输出参数"`
|
|
|
|
|
|
ErrorMessage string `orm:"error_message" json:"errorMessage" description:"错误信息"`
|
|
|
|
|
|
TraceId string `orm:"trace_id" json:"traceId" description:"跟踪ID"`
|
|
|
|
|
|
SessionId string `orm:"session_id" json:"sessionId" description:"会话ID"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type flowExecutionCol struct {
|
|
|
|
|
|
beans.SQLBaseCol
|
|
|
|
|
|
FlowUserId string
|
|
|
|
|
|
FlowName string
|
|
|
|
|
|
TriggerType string
|
|
|
|
|
|
DurationMs string
|
|
|
|
|
|
Status string
|
|
|
|
|
|
FlowContent string
|
|
|
|
|
|
NodeInputParams string
|
|
|
|
|
|
OutputParams string
|
|
|
|
|
|
ErrorMessage string
|
|
|
|
|
|
TraceId string
|
|
|
|
|
|
SessionId string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var FlowExecutionCol = flowExecutionCol{
|
|
|
|
|
|
SQLBaseCol: beans.DefSQLBaseCol,
|
|
|
|
|
|
FlowUserId: "flow_user_id",
|
|
|
|
|
|
FlowName: "flow_name",
|
|
|
|
|
|
TriggerType: "trigger_type",
|
|
|
|
|
|
DurationMs: "duration_ms",
|
|
|
|
|
|
Status: "status",
|
|
|
|
|
|
FlowContent: "flow_content",
|
|
|
|
|
|
NodeInputParams: "node_input_params",
|
|
|
|
|
|
OutputParams: "output_params",
|
|
|
|
|
|
ErrorMessage: "error_message",
|
|
|
|
|
|
TraceId: "trace_id",
|
|
|
|
|
|
SessionId: "session_id",
|
|
|
|
|
|
}
|