package node import ( "ai-agent/workflow/consts/node" flowDto "ai-agent/workflow/model/dto/flow" "ai-agent/workflow/model/entity" "gitea.redpowerfuture.com/red-future/common/beans" "github.com/gogf/gf/v2/frame/g" ) // CreateNodeExecutionReq 创建节点执行记录请求 type CreateNodeExecutionReq struct { g.Meta `path:"/create" method:"post" tags:"节点执行记录" summary:"创建节点执行记录" dc:"创建节点执行记录"` FlowExecutionId int64 `json:"flowExecutionId" v:"required#流程执行ID不能为空"` NodeId string `json:"nodeId" v:"required#节点ID不能为空"` NodeName string `json:"nodeName"` NodeGroupId string `json:"nodeGroupId"` Status node.NodeExecutionStatus `json:"status"` InputParams *flowDto.NodeExecutionInput `json:"inputParams"` } type CreateNodeExecutionRes struct { Id int64 `json:"id,string"` } // UpdateNodeExecutionReq 更新节点执行记录请求 type UpdateNodeExecutionReq struct { g.Meta `path:"/update" method:"put" tags:"节点执行记录" summary:"更新节点执行记录" dc:"更新节点执行记录状态和结果"` Id int64 `json:"id" v:"required#ID不能为空"` InputParams *flowDto.NodeExecutionInput `json:"inputParams"` PromptTokens int `json:"promptTokens"` CompletionTokens int `json:"completionTokens"` TotalTokens int `json:"totalTokens"` Status node.NodeExecutionStatus `json:"status"` DurationMs int64 `json:"durationMs"` ErrorMessage string `json:"errorMessage"` } // DeleteNodeExecutionReq 删除节点执行记录请求 type DeleteNodeExecutionReq struct { g.Meta `path:"/delete" method:"delete" tags:"节点执行记录" summary:"删除节点执行记录" dc:"删除节点执行记录"` Id int64 `json:"id" v:"required#ID不能为空"` } // GetNodeExecutionReq 根据ID查询节点执行记录请求 type GetNodeExecutionReq struct { g.Meta `path:"/get" method:"get" tags:"节点执行记录" summary:"查询节点执行记录详情" dc:"根据ID查询节点执行记录详情"` Id int64 `json:"id" v:"required#ID不能为空"` } // ListNodeExecutionByFlowReq 查询流程下所有节点执行记录请求 type ListNodeExecutionByFlowReq struct { g.Meta `path:"/listByFlow" method:"get" tags:"节点执行记录" summary:"查询流程节点执行列表" dc:"查询指定流程执行下的所有节点执行记录"` Page *beans.Page `json:"page"` FlowExecutionId int64 `json:"flowExecutionId" v:"required#流程执行ID不能为空"` } // NodeExecutionResp 节点执行记录响应 type NodeExecutionResp struct { *entity.NodeExecution } // ListNodeExecutionResp 节点执行记录列表响应 type ListNodeExecutionResp struct { List []*entity.NodeExecution `json:"list"` Total int `json:"total"` }