From 68576b21322ff29c92e5b99e25bf4d6eaf4ab372 Mon Sep 17 00:00:00 2001 From: qhd <1766646056@qq.com> Date: Tue, 12 May 2026 14:31:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E5=8F=8A?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=B1=BB=E5=9E=8B=E4=B8=8E=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workflow/consts/node/node_template.go | 8 +++++++- .../controller/flow/flow_execution_controller.go | 4 ++++ workflow/model/dto/flow/flow_execution_dto.go | 2 +- workflow/service/flow/flow_execution_service.go | 12 +++++++++++- workflow/service/node/node_library_service.go | 2 ++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/workflow/consts/node/node_template.go b/workflow/consts/node/node_template.go index 0ac6405..b1f9907 100644 --- a/workflow/consts/node/node_template.go +++ b/workflow/consts/node/node_template.go @@ -16,7 +16,7 @@ const ( NodeNameAudioModel = "音频" NodeNameModel = "模型" NodeNameMerge = "结果合并" - NodeNameJudge = "判断节点" + NodeNameJudge = "条件判断" NodeNameForm = "表单" NodeNameCustomNode = "自定义节点" ) @@ -58,6 +58,11 @@ const ( NodeTypeCustomNode NodeType = "custom_node" ) +const ( + ModelTypeText = 1 + ModelTypeImage = 2 +) + // ======================== 结构定义 ======================== type NodeFormField struct { Value string `json:"value"` @@ -85,6 +90,7 @@ type ModelItem struct { type NodeItem struct { NodeId string `json:"nodeId"` NodeCode NodeType `json:"nodeCode"` + ModelType int `json:"modelType"` NodeName string `json:"nodeName"` // 从常量来 SkillOption bool `json:"skillOption"` FormConfig []NodeFormField `json:"formConfig"` diff --git a/workflow/controller/flow/flow_execution_controller.go b/workflow/controller/flow/flow_execution_controller.go index 65107b0..ad52bd7 100644 --- a/workflow/controller/flow/flow_execution_controller.go +++ b/workflow/controller/flow/flow_execution_controller.go @@ -21,6 +21,10 @@ func (c *flowExecution) ModelCallback(ctx context.Context, req *flowDto.ModelCal return } +func (c *flowExecution) Get(ctx context.Context, req *flowDto.GetFlowExecutionReq) (res *flowDto.VOFlowExecution, err error) { + return flowService.FlowExecutionService.Get(ctx, req) +} + func (c *flowExecution) List(ctx context.Context, req *flowDto.ListFlowExecutionReq) (res *flowDto.ListFlowExecutionTreeRes, err error) { return flowService.FlowExecutionService.List(ctx, req) } diff --git a/workflow/model/dto/flow/flow_execution_dto.go b/workflow/model/dto/flow/flow_execution_dto.go index fca2c31..0c40652 100644 --- a/workflow/model/dto/flow/flow_execution_dto.go +++ b/workflow/model/dto/flow/flow_execution_dto.go @@ -219,7 +219,7 @@ type OutputItem struct { } type FlowNode struct { FlowName string `json:"flowName" description:"流程名称"` - FlowId int64 `json:"flowId,string" description:"流程ID"` + Id int64 `json:"Id,string" description:"任务ID"` SessionId string `json:"sessionId" description:"会话ID"` Items []OutputItem `json:"items" description:"输出项列表"` } diff --git a/workflow/service/flow/flow_execution_service.go b/workflow/service/flow/flow_execution_service.go index 0532de1..6188b1c 100644 --- a/workflow/service/flow/flow_execution_service.go +++ b/workflow/service/flow/flow_execution_service.go @@ -25,6 +25,16 @@ var FlowExecutionService = &flowExecutionService{} type flowExecutionService struct{} +func (s *flowExecutionService) Get(ctx context.Context, req *flowDto.GetFlowExecutionReq) (res *flowDto.VOFlowExecution, err error) { + r, err := flowDao.FlowExecutionDao.Get(ctx, req) + if err != nil { + return nil, err + } + res = new(flowDto.VOFlowExecution) + err = gconv.Struct(r, &res) + return res, err +} + func (s *flowExecutionService) List(ctx context.Context, req *flowDto.ListFlowExecutionReq) (res *flowDto.ListFlowExecutionTreeRes, err error) { user, err := utils.GetUserInfo(ctx) if err != nil { @@ -121,7 +131,7 @@ func (s *flowExecutionService) List(ctx context.Context, req *flowDto.ListFlowEx // 组装节点 node := flowDto.FlowNode{ FlowName: displayFlowName, - FlowId: execution.FlowUserId, + Id: execution.Id, SessionId: gconv.String(execution.SessionId), Items: tempItems, } diff --git a/workflow/service/node/node_library_service.go b/workflow/service/node/node_library_service.go index 3db4e6b..8cadb5f 100644 --- a/workflow/service/node/node_library_service.go +++ b/workflow/service/node/node_library_service.go @@ -25,6 +25,7 @@ func (s *nodeLibraryService) GetNodeLibrary(ctx context.Context, req *nodeDto.Wo { NodeCode: node.NodeTypeTextModel, NodeName: node.NodeNameTextModel, + ModelType: node.ModelTypeText, SkillOption: true, FormConfig: []node.NodeFormField{}, // 技能下拉 ModelConfig: []node.ModelItem{}, @@ -32,6 +33,7 @@ func (s *nodeLibraryService) GetNodeLibrary(ctx context.Context, req *nodeDto.Wo { NodeCode: node.NodeTypeImageModel, NodeName: node.NodeNameImageModel, + ModelType: node.ModelTypeImage, SkillOption: true, FormConfig: []node.NodeFormField{}, // 技能下拉 ModelConfig: []node.ModelItem{},