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{},