feat: 新增主动拉取与多类型回调功能
- 新增 ActivePull 实体、DAO、DTO 及 Service,支持主动拉取任务管理 - 新增 ComposeCallback、VideoCallback、HttpNodeCallback 多类型回调接口 - FlowExecution 增加 NodeGroupId 和 TotalTokens 字段,支持节点组追踪与 Token 统计 - ExecutedNodes 结构由字符串列表改为包含执行状态的节点对象列表 - 重构回调通知机制,统一 Notify 函数调用 - 优化输出项类型判断逻辑,新增文件类型标识
This commit is contained in:
45
workflow/controller/node/node_prompt_controller.go
Normal file
45
workflow/controller/node/node_prompt_controller.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
nodeDto "ai-agent/workflow/model/dto/node"
|
||||
nodeService "ai-agent/workflow/service/node"
|
||||
"context"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type nodePrompt struct{}
|
||||
|
||||
var NodePrompt = new(nodePrompt)
|
||||
|
||||
// Create 创建节点提示词
|
||||
func (c *nodePrompt) Create(ctx context.Context, req *nodeDto.CreateNodePromptReq) (res *nodeDto.CreateNodePromptRes, err error) {
|
||||
return nodeService.NodePromptService.Create(ctx, req)
|
||||
}
|
||||
|
||||
// Update 更新节点提示词
|
||||
func (c *nodePrompt) Update(ctx context.Context, req *nodeDto.UpdateNodePromptReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = nodeService.NodePromptService.Update(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除节点提示词
|
||||
func (c *nodePrompt) Delete(ctx context.Context, req *nodeDto.DeleteNodePromptReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = nodeService.NodePromptService.Delete(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 根据ID查询节点提示词详情
|
||||
func (c *nodePrompt) Get(ctx context.Context, req *nodeDto.GetNodePromptReq) (res *nodeDto.NodePromptResp, err error) {
|
||||
return nodeService.NodePromptService.GetById(ctx, req)
|
||||
}
|
||||
|
||||
// ListMy 查询当前用户自己创建的节点提示词列表
|
||||
func (c *nodePrompt) ListMy(ctx context.Context, req *nodeDto.ListMyNodePromptReq) (res *nodeDto.ListNodePromptResp, err error) {
|
||||
return nodeService.NodePromptService.ListMy(ctx, req)
|
||||
}
|
||||
|
||||
// List 查询节点提示词列表,包含系统和当前创建人自定义
|
||||
func (c *nodePrompt) List(ctx context.Context, req *nodeDto.ListNodePromptReq) (res *nodeDto.ListNodePromptResp, err error) {
|
||||
return nodeService.NodePromptService.ListWithSystem(ctx, req)
|
||||
}
|
||||
Reference in New Issue
Block a user