46 lines
1.6 KiB
Go
46 lines
1.6 KiB
Go
package node
|
|
|
|
import (
|
|
nodeDto "ai-agent/workflow/model/dto/node"
|
|
nodeService "ai-agent/workflow/service/node"
|
|
"context"
|
|
|
|
"gitea.redpowerfuture.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)
|
|
}
|