handler

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvTypeScript        = "script"        // 脚本工作区
	EnvTypeAnalysis      = "analysis"      // 分析(analysis 级)
	EnvTypeAnalysisNode  = "analysisNode"  // 分析节点
	EnvTypeProjectReport = "projectReport" // 项目报告
)

RuntimeEnvType 是与前端 llmEnv.type 约定的「业务上下文」枚举。

前端通过 setLLMEnv(id, type) 设置全局上下文,后端据此解析出:

  • SystemPrompt:注入给 Agent 的系统提示词(含工作目录与工具使用约束);
  • WorkingDir:Agent 执行时的工作目录。

这些枚举是前端与后端之间的契约,新增业务上下文时在此登记并同步前端 llm-env.ts。

Variables

This section is empty.

Functions

func GetDefaultIOSchame

func GetDefaultIOSchame() string

func GetInitScript

func GetInitScript(scriptType string) string

func RegisterOnlyOfficeRoutes

func RegisterOnlyOfficeRoutes(r *gin.Engine, proxyHandler *ProxyHandler)

func RegisterProjectDocsRoute

func RegisterProjectDocsRoute(r *gin.Engine, cfg *config.Config)

RegisterProjectDocsRoute registers project docs entry route. It maps: - GET /docs/:projectid to {base_dir}/data/{projectid}/docs/index.html - GET /docs/:projectid/*filepath to {base_dir}/data/{projectid}/docs/*filepath

Types

type AISummaryHandler added in v0.1.2

type AISummaryHandler struct {
	// contains filtered or unexported fields
}

AISummaryHandler 处理 AI 摘要相关接口。

func NewAISummaryHandler added in v0.1.2

func NewAISummaryHandler(aiSummaryService interfaces.AISummaryService) *AISummaryHandler

func (*AISummaryHandler) CreateAISummary added in v0.1.2

func (h *AISummaryHandler) CreateAISummary(c *gin.Context)

CreateAISummary godoc @Summary 创建 AI 摘要 @Description 根据 OwnerID/OwnerType 创建摘要记录,并异步触发 LLM 生成摘要 @Tags AI摘要 @Accept json @Produce json @Param request body createAISummaryRequest true "请求参数" @Success 200 {object} types.AISummary @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /ai-summary/create [post]

func (*AISummaryHandler) DeleteAISummary added in v0.1.2

func (h *AISummaryHandler) DeleteAISummary(c *gin.Context)

DeleteAISummary godoc @Summary 删除 AI 摘要 @Description 按摘要 ID 删除 AI 摘要记录 @Tags AI摘要 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /ai-summary/delete [post]

func (*AISummaryHandler) GetAISummary added in v0.1.2

func (h *AISummaryHandler) GetAISummary(c *gin.Context)

GetAISummary godoc @Summary 获取 AI 摘要 @Description 按 ID 查询 AI 摘要详情 @Tags AI摘要 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.AISummary @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /ai-summary/get [get]

func (*AISummaryHandler) GetAISummaryInput added in v0.1.2

func (h *AISummaryHandler) GetAISummaryInput(c *gin.Context)

GetAISummaryInput godoc @Summary 获取 AI 摘要的 LLM 输入信息 @Description 根据 OwnerID/OwnerType 解析生成摘要时交给 LLM 的系统提示词、工作目录与原始内容 @Tags AI摘要 @Produce json @Param owner_id query integer true "所属对象 ID" @Param owner_type query string true "所属对象类型:analysis 或 analysis_node" @Success 200 {object} types.AISummaryInput @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /ai-summary/input [get]

func (*AISummaryHandler) ListAISummary added in v0.1.2

func (h *AISummaryHandler) ListAISummary(c *gin.Context)

ListAISummary godoc @Summary 按所属对象查询 AI 摘要列表 @Description 根据 OwnerID/OwnerType 查询 AI 摘要列表 @Tags AI摘要 @Produce json @Param owner_id query integer true "所属对象 ID" @Param owner_type query string true "所属对象类型:analysis 或 analysis_node" @Success 200 {array} types.AISummary @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /ai-summary/list [get]

func (*AISummaryHandler) RegenerateAISummary added in v0.1.2

func (h *AISummaryHandler) RegenerateAISummary(c *gin.Context)

RegenerateAISummary godoc @Summary 重新生成 AI 摘要 @Description 按摘要 ID 重置状态并异步重新触发 LLM 生成摘要 @Tags AI摘要 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} types.AISummary @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /ai-summary/regenerate [post]

type AgentHandler added in v0.1.2

type AgentHandler struct {
	// contains filtered or unexported fields
}

AgentHandler 处理 Agent 任务与权限相关接口。

职责边界(对应 design.md):

  • HTTP 是 command(创建任务 / 批准 / 拒绝);
  • WS 是 notification(通过 AgentService.Subscribe 把事件推送给创建任务的用户);
  • AgentService / Repository 是真正的 state。

func NewAgentHandler added in v0.1.2

func NewAgentHandler(svc *agent.AgentService, conv *agent.ConversationService, hub *realtime.Hub, runtimeCtx *RuntimeContextResolver, skills *skill.Registry) *AgentHandler

NewAgentHandler 创建 AgentHandler。

func (*AgentHandler) ApprovePermission added in v0.1.2

func (h *AgentHandler) ApprovePermission(c *gin.Context)

ApprovePermission godoc @Summary 批准权限请求 @Tags Agent @Accept json @Produce json @Param request body permissionIDBody true "权限 ID" @Success 200 {object} gin.H @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 409 {object} errors.AppError @Security Bearer @Router /agent/permission/approve [post]

func (*AgentHandler) CancelTask added in v0.1.2

func (h *AgentHandler) CancelTask(c *gin.Context)

CancelTask godoc @Summary 取消 Agent 任务 @Tags Agent @Accept json @Produce json @Param request body taskIDBody true "任务 ID" @Success 200 {object} gin.H @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/task/cancel [post]

func (*AgentHandler) Chat added in v0.1.2

func (h *AgentHandler) Chat(c *gin.Context)

Chat godoc @Summary 多轮对话 @Description 发送一条消息:新建会话或续接已有会话;返回本轮任务 ID,实时内容走 WS 推送 @Tags Agent @Accept json @Produce json @Param request body handler.chatRequest true "请求参数" @Success 200 {object} gin.H @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/chat [post]

func (*AgentHandler) CreateTask added in v0.1.2

func (h *AgentHandler) CreateTask(c *gin.Context)

CreateTask godoc @Summary 创建 Agent 任务 @Description 创建任务、订阅事件流到 WS,并异步启动执行 @Tags Agent @Accept json @Produce json @Param request body agent.Request true "请求参数" @Success 200 {object} agent.Task @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /agent/task/create [post]

func (*AgentHandler) DeleteMemory added in v0.1.2

func (h *AgentHandler) DeleteMemory(c *gin.Context)

DeleteMemory godoc @Summary 删除记忆 @Tags Agent @Accept json @Produce json @Param request body taskIDBody true "记忆 ID" @Success 200 {object} gin.H @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/memory/delete [post]

func (*AgentHandler) DeleteProfile added in v0.1.2

func (h *AgentHandler) DeleteProfile(c *gin.Context)

DeleteProfile godoc @Summary 删除 Agent Profile @Description 仅能删除当前用户的自定义 Profile;内置 Profile 不可删除 @Tags Agent @Accept json @Produce json @Param request body taskIDBody true "Profile ID" @Success 200 {object} gin.H @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/profile/delete [post]

func (*AgentHandler) DenyPermission added in v0.1.2

func (h *AgentHandler) DenyPermission(c *gin.Context)

DenyPermission godoc @Summary 拒绝权限请求 @Tags Agent @Accept json @Produce json @Param request body permissionIDBody true "权限 ID" @Success 200 {object} gin.H @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 409 {object} errors.AppError @Security Bearer @Router /agent/permission/deny [post]

func (*AgentHandler) DescribeEnv added in v0.1.2

func (h *AgentHandler) DescribeEnv(c *gin.Context)

DescribeEnv godoc @Summary 解析当前对话的业务上下文 @Description 根据 env{id,type} 返回人类可读的上下文名称与工作目录,供前端展示当前对话环境 @Tags Agent @Accept json @Produce json @Param request body handler.describeEnvRequest true "业务上下文" @Success 200 {object} RuntimeContextInfo @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /agent/env/describe [post]

func (*AgentHandler) GetConversation added in v0.1.2

func (h *AgentHandler) GetConversation(c *gin.Context)

GetConversation godoc @Summary 获取会话(含完整历史消息) @Tags Agent @Produce json @Param id query string true "会话 ID" @Success 200 {object} agent.Conversation @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/conversation/get [get]

func (*AgentHandler) GetMemory added in v0.1.2

func (h *AgentHandler) GetMemory(c *gin.Context)

GetMemory godoc @Summary 获取单条记忆 @Tags Agent @Produce json @Param id query string true "记忆 ID" @Success 200 {object} agent.Memory @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/memory/get [get]

func (*AgentHandler) GetPendingPermissions added in v0.1.2

func (h *AgentHandler) GetPendingPermissions(c *gin.Context)

GetPendingPermissions godoc @Summary 获取任务待确认权限 @Tags Agent @Produce json @Param task_id query string true "任务 ID" @Success 200 {array} agent.PermissionRequest @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/task/permissions [get]

func (*AgentHandler) GetTask added in v0.1.2

func (h *AgentHandler) GetTask(c *gin.Context)

GetTask godoc @Summary 获取 Agent 任务 @Tags Agent @Produce json @Param id query string true "任务 ID" @Success 200 {object} agent.Task @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/task/get [get]

func (*AgentHandler) GetTaskEvents added in v0.1.2

func (h *AgentHandler) GetTaskEvents(c *gin.Context)

GetTaskEvents godoc @Summary 增量拉取任务事件 @Description 返回 sequence 大于 after 的事件;浏览器刷新后用此接口恢复历史 @Tags Agent @Produce json @Param task_id query string true "任务 ID" @Param after query int false "上次收到的最大 sequence" @Success 200 {array} agent.AgentEvent @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/task/events [get]

func (*AgentHandler) GetTaskRequest added in v0.1.3

func (h *AgentHandler) GetTaskRequest(c *gin.Context)

GetTaskRequest godoc @Summary 获取任务实际发送给 LLM 的请求内容 @Description 按任务 ID 加载任务,应用 Agent Profile(系统提示词合并、技能选择、记忆/项目上下文注入),返回最终 Request @Tags Agent @Produce json @Param id query string true "任务 ID" @Success 200 {object} agent.Request @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/task/request [get]

func (*AgentHandler) ListProfiles added in v0.1.2

func (h *AgentHandler) ListProfiles(c *gin.Context)

ListProfiles godoc @Summary 查看 Agent Profile @Description 返回内置与当前用户自定义的全部 Profile(合并视图),包含系统提示词、技能与上下文注入开关 @Tags Agent @Produce json @Success 200 {array} agent.Profile @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/profile/list [get]

func (*AgentHandler) ListSkills added in v0.1.2

func (h *AgentHandler) ListSkills(c *gin.Context)

ListSkills godoc @Summary 查看 Agent 技能 @Description 返回当前可用的全部技能(内置 + 用户自定义),包含名称、描述、入参 schema、版本与指令正文 @Tags Agent @Produce json @Success 200 {array} skill.Manifest @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/skill/list [get]

func (*AgentHandler) PageConversations added in v0.1.2

func (h *AgentHandler) PageConversations(c *gin.Context)

PageConversations godoc @Summary 分页查询当前用户的会话 @Tags Agent @Accept json @Produce json @Param request body handler.conversationPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/conversation/page [post]

func (*AgentHandler) PageEvents added in v0.1.2

func (h *AgentHandler) PageEvents(c *gin.Context)

PageEvents godoc @Summary 分页查询任务事件 @Tags Agent @Accept json @Produce json @Param request body handler.agentEventPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/event/page [post]

func (*AgentHandler) PageMemory added in v0.1.2

func (h *AgentHandler) PageMemory(c *gin.Context)

PageMemory godoc @Summary 分页查询当前用户的记忆 @Tags Agent @Accept json @Produce json @Param request body handler.agentMemoryPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/memory/page [post]

func (*AgentHandler) PagePermissions added in v0.1.2

func (h *AgentHandler) PagePermissions(c *gin.Context)

PagePermissions godoc @Summary 分页查询权限请求 @Tags Agent @Accept json @Produce json @Param request body handler.agentPermissionPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/permission/page [post]

func (*AgentHandler) PageTasks added in v0.1.2

func (h *AgentHandler) PageTasks(c *gin.Context)

PageTasks godoc @Summary 分页查询 Agent 任务 @Tags Agent @Accept json @Produce json @Param request body handler.agentTaskPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/task/page [post]

func (*AgentHandler) ProjectContext added in v0.1.2

func (h *AgentHandler) ProjectContext(c *gin.Context)

ProjectContext godoc @Summary 查看当前用户的项目上下文 @Description 返回当前用户激活项目下已注入 Agent 系统提示词的项目上下文文本块(如已完成的分析节点) @Tags Agent @Produce json @Success 200 {object} gin.H @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /agent/project-context [get]

func (*AgentHandler) RetrieveMemory added in v0.1.2

func (h *AgentHandler) RetrieveMemory(c *gin.Context)

RetrieveMemory godoc @Summary 检索当前用户的相关记忆 @Tags Agent @Accept json @Produce json @Param request body handler.memoryRetrieveRequest true "检索参数" @Success 200 {array} agent.Memory @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/memory/retrieve [post]

func (*AgentHandler) SaveMemory added in v0.1.2

func (h *AgentHandler) SaveMemory(c *gin.Context)

SaveMemory godoc @Summary 创建或更新记忆 @Description ID 为空时新建,否则更新;UserID 由当前登录用户注入 @Tags Agent @Accept json @Produce json @Param request body handler.memorySaveRequest true "记忆内容" @Success 200 {object} agent.Memory @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /agent/memory/save [post]

func (*AgentHandler) SaveProfile added in v0.1.2

func (h *AgentHandler) SaveProfile(c *gin.Context)

SaveProfile godoc @Summary 创建或更新 Agent Profile @Description ID 为空时新建,否则更新;UserID 由当前登录用户注入,仅能管理自己的自定义 Profile @Tags Agent @Accept json @Produce json @Param request body handler.profileSaveRequest true "Profile 内容" @Success 200 {object} agent.Profile @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /agent/profile/save [post]

type AnalysisHandler

type AnalysisHandler struct {
	// contains filtered or unexported fields
}

func NewAnalysisHandler

func NewAnalysisHandler(
	analysisService interfaces.AnalysisService,
	projectService interfaces.ProjectService,
	projectRepo interfaces.ProjectRepository,
	workflowService interfaces.WorkflowService,
	dataService interfaces.DataService,
	containerService interfaces.ContainerService,
	analysisRepo interfaces.AnalysisRepository,
	dagOrchestrator interfaces.DagOrchestrator,
	dynamicDagOrchestrator interfaces.DynamicDagOrchestrator,
	dataflowDagOrchestrator interfaces.DataflowDagOrchestrator,
	nodeOrchestrator interfaces.NodeOrchestrator,
	aiSummaryRepo interfaces.AISummaryRepository,
	cfg *config.Config,
) *AnalysisHandler

func (*AnalysisHandler) AnalysisNodeLogs

func (h *AnalysisHandler) AnalysisNodeLogs(c *gin.Context)

func (*AnalysisHandler) AnalysisNodeParams

func (h *AnalysisHandler) AnalysisNodeParams(c *gin.Context)

func (*AnalysisHandler) DeleteAnalysis

func (h *AnalysisHandler) DeleteAnalysis(c *gin.Context)

DeleteAnalysis godoc @Summary 删除分析任务 @Description 按 analysisId 删除分析任务,同时清理关联的 analysis_nodes、analysis_edges、container_instances 及工作目录 @Tags 分析 @Produce json @Param analysisId path string true "分析 ID" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/delete/{analysisId} [post]

func (*AnalysisHandler) DeleteAnalysisNode

func (h *AnalysisHandler) DeleteAnalysisNode(c *gin.Context)

DeleteAnalysisNode godoc @Summary 删除分析节点 @Description 按 analysisNodeId 删除分析节点记录 @Tags 分析 @Produce json @Param analysisNodeId path string true "分析节点 ID" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/node/delete/{analysisNodeId} [post]

func (*AnalysisHandler) EditNodeParams

func (h *AnalysisHandler) EditNodeParams(c *gin.Context)

EditNodeParams godoc @Summary 编辑分析节点参数 @Description 依次查询 AnalysisNode、Analysis、Workflow(dag_definition)、Module(io_schema) 后组装 formJson @Tags 分析 @Produce json @Param analysisNodeId path string true "分析节点 ID" @Success 200 {object} handler.EditNodeParamsResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/edit-node-params/{analysisNodeId} [post]

func (*AnalysisHandler) EditParamsV2

func (h *AnalysisHandler) EditParamsV2(c *gin.Context)

EditParamsV2 godoc @Summary 编辑分析参数(V2) @Description 查询 analysis 基础信息,并按 workflowId 复用工作流表单逻辑返回 formJson 与 analysis_result @Tags 分析 @Produce json @Param analysisId path string true "分析 ID" @Success 200 {object} handler.EditParamsV2Response @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/edit-params-v2/{analysisId} [post]

func (*AnalysisHandler) GetAnalysisNode

func (h *AnalysisHandler) GetAnalysisNode(c *gin.Context) *types.AnalysisNode

func (*AnalysisHandler) ListAnalysisTree

func (h *AnalysisHandler) ListAnalysisTree(c *gin.Context)

ListAnalysisTree godoc @Summary 分析树列表 @Description 兼容 Python /list-analysis-tree,按 workflow(relation) 分组返回分析树,子节点 key 使用 analysis_id @Tags 分析 @Accept json @Produce json @Param request body handler.listAnalysisTreeRequest true "查询参数" @Success 200 {array} handler.listAnalysisTreeParent @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /list-analysis-tree [post]

func (*AnalysisHandler) PageAnalysisByProject

func (h *AnalysisHandler) PageAnalysisByProject(c *gin.Context)

PageAnalysisByProject godoc @Summary 按当前项目分页查询分析任务 @Description 默认按当前用户 active project 的 project_id 过滤,支持可选 query 条件 @Tags 分析 @Accept json @Produce json @Param request body handler.analysisByProjectPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/list-by-project-page [post]

func (*AnalysisHandler) PageAnalysisNodeByProject

func (h *AnalysisHandler) PageAnalysisNodeByProject(c *gin.Context)

PageAnalysisNodeByProject godoc @Summary 按当前项目分页查询分析节点 @Description 默认按当前用户 active project 的 project_id 过滤,支持可选 script_id @Tags 分析 @Accept json @Produce json @Param request body handler.analysisNodeByProjectPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/node/list-by-project-page [post]

func (*AnalysisHandler) ParseParams

func (h *AnalysisHandler) ParseParams(c *gin.Context)

func (*AnalysisHandler) PublishProjectReportToDoc added in v0.1.2

func (h *AnalysisHandler) PublishProjectReportToDoc(c *gin.Context)

PublishProjectReportToDoc copies a file-based project report into the project doc directory and registers a link in SUMMARY.md.

func (*AnalysisHandler) PublishScriptAnalysisNodeToDoc

func (h *AnalysisHandler) PublishScriptAnalysisNodeToDoc(c *gin.Context)

func (*AnalysisHandler) PublishToDocByAnalysisID

func (h *AnalysisHandler) PublishToDocByAnalysisID(c *gin.Context)

func (*AnalysisHandler) PublishToDocByAnalysisNodeID

func (h *AnalysisHandler) PublishToDocByAnalysisNodeID(c *gin.Context)

func (*AnalysisHandler) PublishToDocByWorkflowID

func (h *AnalysisHandler) PublishToDocByWorkflowID(c *gin.Context)

func (*AnalysisHandler) RunAnalysisNode

func (h *AnalysisHandler) RunAnalysisNode(c *gin.Context)

func (*AnalysisHandler) RunAnalysisNodeByScriptID

func (h *AnalysisHandler) RunAnalysisNodeByScriptID(c *gin.Context)

RunAnalysisNodeByScriptID 批量运行 script 下所有 creation_source=standalone 的 analysis node

func (*AnalysisHandler) RunAnalysisNodeWithID

func (h *AnalysisHandler) RunAnalysisNodeWithID(ctx context.Context, analsyisNodeId int64) error

func (*AnalysisHandler) SaveAnalysisController

func (h *AnalysisHandler) SaveAnalysisController(c *gin.Context)

func (*AnalysisHandler) SaveAnalysisControllerV2

func (h *AnalysisHandler) SaveAnalysisControllerV2(c *gin.Context)

SaveAnalysisControllerV2 keeps the current JSON dag definition and analysis schema, but starts a dynamic Nextflow-like scheduler path that materializes analysis nodes at runtime.

func (*AnalysisHandler) SaveAnalysisControllerV3

func (h *AnalysisHandler) SaveAnalysisControllerV3(c *gin.Context)

SaveAnalysisControllerV3 keeps the current request payload and persistence schema, while using the V3 dataflow orchestrator entry (Nextflow-like model).

func (*AnalysisHandler) SaveAnalysisNodeControllerWithScript

func (h *AnalysisHandler) SaveAnalysisNodeControllerWithScript(c *gin.Context)

func (*AnalysisHandler) StopAnalysis

func (h *AnalysisHandler) StopAnalysis(c *gin.Context)

func (*AnalysisHandler) StopAnalysisNode

func (h *AnalysisHandler) StopAnalysisNode(c *gin.Context)

func (*AnalysisHandler) ToggleAnalysisReport

func (h *AnalysisHandler) ToggleAnalysisReport(c *gin.Context)

ToggleAnalysisReport godoc @Summary 切换分析任务的 is_report 状态 @Description 按 analysisId 切换 is_report 字段的 true/false 值 @Tags 分析 @Produce json @Param analysisId path string true "分析 ID" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/toggle-report/{analysisId} [post]

func (*AnalysisHandler) VisualizationNodeFile

func (h *AnalysisHandler) VisualizationNodeFile(c *gin.Context)

VisualizationNodeFile godoc @Summary 分析节点结果文件可视化 @Description 查询 AnalysisNode 并补充容器模板与镜像信息,同时返回 output_dir 下可视化资源列表 @Tags 分析 @Produce json @Param analysisNodeId path string true "分析节点 ID" @Success 200 {object} handler.VisualizationNodeFileResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/visualization-node-file/{analysisNodeId} [get]

func (*AnalysisHandler) VisualizationNodeTree

func (h *AnalysisHandler) VisualizationNodeTree(c *gin.Context)

VisualizationNodeTree godoc @Summary 分析节点树可视化 @Description 按 workflow dag_definition 的脚本节点分组,返回 analysis nodes 树结构 @Tags 分析 @Produce json @Param analysisId path string true "分析 ID" @Success 200 {object} handler.VisualizationNodeTreeResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/visualization-node-tree/{analysisId} [get]

type AuthHandler

type AuthHandler struct {
	// contains filtered or unexported fields
}

AuthHandler implements HTTP request handlers for user authentication Provides functionality for user registration, login, logout, and token management through the REST API endpoints

func NewAuthHandler

func NewAuthHandler(configInfo *config.Config,
	userService interfaces.UserService,
	projectService interfaces.ProjectService) *AuthHandler

func (*AuthHandler) ChangePassword

func (h *AuthHandler) ChangePassword(c *gin.Context)

ChangePassword godoc @Summary 修改密码 @Description 修改当前用户的登录密码 @Tags 认证 @Accept json @Produce json @Param request body object{old_password=string,new_password=string} true "密码修改请求" @Success 200 {object} map[string]interface{} "修改成功" @Failure 400 {object} errors.AppError "请求参数错误" @Security Bearer @Router /auth/change-password [post]

func (*AuthHandler) GetCurrentUser

func (h *AuthHandler) GetCurrentUser(c *gin.Context)

GetCurrentUser godoc @Summary 获取当前用户信息 @Description 获取当前登录用户的详细信息 @Tags 认证 @Accept json @Produce json @Success 200 {object} map[string]interface{} "用户信息" @Failure 401 {object} errors.AppError "未授权" @Security Bearer @Router /auth/me [get]

func (*AuthHandler) Login

func (h *AuthHandler) Login(c *gin.Context)

Login godoc @Summary 用户登录 @Description 用户登录并获取访问令牌 @Tags 认证 @Accept json @Produce json @Param request body types.LoginRequest true "登录请求参数" @Success 200 {object} types.LoginResponse @Failure 401 {object} errors.AppError "认证失败" @Router /auth/login [post]

func (*AuthHandler) Logout

func (h *AuthHandler) Logout(c *gin.Context)

Logout godoc @Summary 用户登出 @Description 撤销当前访问令牌并登出 @Tags 认证 @Accept json @Produce json @Success 200 {object} map[string]interface{} "登出成功" @Failure 400 {object} errors.AppError "请求参数错误" @Security Bearer @Router /auth/logout [post]

func (*AuthHandler) RefreshToken

func (h *AuthHandler) RefreshToken(c *gin.Context)

RefreshToken godoc @Summary 刷新令牌 @Description 使用刷新令牌获取新的访问令牌 @Tags 认证 @Accept json @Produce json @Param request body object{refreshToken=string} true "刷新令牌" @Success 200 {object} map[string]interface{} "新令牌" @Failure 401 {object} errors.AppError "令牌无效" @Router /auth/refresh [post]

func (*AuthHandler) Register

func (h *AuthHandler) Register(c *gin.Context)

Register godoc @Summary 用户注册 @Description 注册新用户账号 @Tags 认证 @Accept json @Produce json @Param request body types.RegisterRequest true "注册请求参数" @Success 201 {object} types.RegisterResponse @Failure 400 {object} errors.AppError "请求参数错误" @Failure 403 {object} errors.AppError "注册功能已禁用" @Router /auth/register [post]

func (*AuthHandler) UpdateProfile added in v0.1.2

func (h *AuthHandler) UpdateProfile(c *gin.Context)

UpdateProfile godoc @Summary 更新当前用户的 Agent Profile @Description 修改当前登录用户选中的 AgentProfile(仅允许修改自己的 Profile 选择) @Tags 认证 @Accept json @Produce json @Param request body object{profile=string} true "Agent Profile 名称" @Success 200 {object} map[string]interface{} "更新成功" @Failure 400 {object} errors.AppError "请求参数错误" @Security Bearer @Router /auth/profile [post]

func (*AuthHandler) ValidateToken

func (h *AuthHandler) ValidateToken(c *gin.Context)

ValidateToken godoc @Summary 验证令牌 @Description 验证访问令牌是否有效 @Tags 认证 @Accept json @Produce json @Success 200 {object} map[string]interface{} "令牌有效" @Failure 401 {object} errors.AppError "令牌无效" @Security Bearer @Router /auth/validate [get]

type ContainerHandler

type ContainerHandler struct {
	// contains filtered or unexported fields
}

func NewContainerHandler

func NewContainerHandler(containerService interfaces.ContainerService,
	projectService interfaces.ProjectService,
	analysisService interfaces.AnalysisService, workflowService interfaces.WorkflowService,
	containerManager *manager.ContainerManager,
	cfg *config.Config) *ContainerHandler

func (*ContainerHandler) CreateAppSession

func (h *ContainerHandler) CreateAppSession(c *gin.Context)

CreateAppSession godoc @Summary 创建应用会话 @Description 输入 ContainerTemplateID + 当前用户 + ProjectID 创建 AppSession,并通过 ContainerManager 创建并绑定容器 @Tags 容器管理 @Accept json @Produce json @Param request body appSessionCreateRequest true "请求参数" @Success 200 {object} types.AppSession @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/create [post]

func (*ContainerHandler) CreateAppSessionByAnalysisNode

func (h *ContainerHandler) CreateAppSessionByAnalysisNode(c *gin.Context)

CreateAppSessionByAnalysisNode godoc @Summary 通过分析节点创建应用会话 @Description 依据 analysis_node_id 查询 AnalysisNode/Analysis/Module,自动推导 ProjectID、ContainerTemplateID、WorkspacePath 并创建 AppSession @Tags 容器管理 @Accept json @Produce json @Param request body appSessionCreateByAnalysisNodeRequest true "请求参数" @Success 200 {object} types.AppSession @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/create-by-analysis-node [post]

func (*ContainerHandler) CreateContainerImage

func (h *ContainerHandler) CreateContainerImage(c *gin.Context)

CreateContainerImage godoc @Summary 创建容器镜像 @Description 创建 ContainerImage 记录 @Tags 容器管理 @Accept json @Produce json @Param request body types.ContainerImage true "请求参数" @Success 200 {object} types.ContainerImage @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/image/create [post]

func (*ContainerHandler) CreateContainerTemplate

func (h *ContainerHandler) CreateContainerTemplate(c *gin.Context)

CreateContainerTemplate godoc @Summary 创建容器模板 @Description 创建 ContainerTemplate 记录(手动校验 ImageID,不使用 GORM 关系维护) @Tags 容器管理 @Accept json @Produce json @Param request body types.ContainerTemplate true "请求参数" @Success 200 {object} types.ContainerTemplate @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template/create [post]

func (*ContainerHandler) DeleteAppSession

func (h *ContainerHandler) DeleteAppSession(c *gin.Context)

DeleteAppSession godoc @Summary 删除应用会话 @Description 通过 ContainerManager 删除绑定容器,并删除 AppSession @Tags 容器管理 @Accept json @Produce json @Param request body appSessionIDBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/delete [post]

func (*ContainerHandler) DeleteContainerImage

func (h *ContainerHandler) DeleteContainerImage(c *gin.Context)

DeleteContainerImage godoc @Summary 删除容器镜像 @Description 按 ID 删除 ContainerImage 记录 @Tags 容器管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/image/delete [post]

func (*ContainerHandler) DeleteContainerTemplate

func (h *ContainerHandler) DeleteContainerTemplate(c *gin.Context)

DeleteContainerTemplate godoc @Summary 删除容器模板 @Description 按 ID 删除 ContainerTemplate 记录 @Tags 容器管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template/delete [post]

func (*ContainerHandler) GetAppSession

func (h *ContainerHandler) GetAppSession(c *gin.Context)

GetAppSession godoc @Summary 获取应用会话 @Description 按 ID 查询当前用户的 AppSession 详情 @Tags 容器管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.AppSession @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/get [get]

func (*ContainerHandler) GetContainerImage

func (h *ContainerHandler) GetContainerImage(c *gin.Context)

GetContainerImage godoc @Summary 获取容器镜像 @Description 按 ID 查询 ContainerImage 详情 @Tags 容器管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.ContainerImage @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/image/get [get]

func (*ContainerHandler) GetContainerTemplate

func (h *ContainerHandler) GetContainerTemplate(c *gin.Context)

GetContainerTemplate godoc @Summary 获取容器模板 @Description 按 ID 查询 ContainerTemplate 详情 @Tags 容器管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.ContainerTemplate @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template/get [get]

func (*ContainerHandler) GetQueueStatus

func (h *ContainerHandler) GetQueueStatus(c *gin.Context)

GetQueueStatus godoc @Summary 容器队列状态 @Description 返回队列的运行中/等待中/最大并发/最大排队数量 @Tags 容器管理 @Produce json @Success 200 {object} map[string]interface{} @Failure 401 {object} errors.AppError @Security Bearer @Router /container/queue/status [get]

func (*ContainerHandler) ListAppSession

func (h *ContainerHandler) ListAppSession(c *gin.Context)

ListAppSession godoc @Summary 应用会话列表 @Description 查询当前用户的 AppSession 列表 @Tags 容器管理 @Produce json @Success 200 {array} types.AppSession @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/list [get]

func (*ContainerHandler) ListContainerImage

func (h *ContainerHandler) ListContainerImage(c *gin.Context)

ListContainerImage godoc @Summary 容器镜像列表 @Description 查询 ContainerImage 列表 @Tags 容器管理 @Produce json @Success 200 {array} types.ContainerImage @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/image/list [get]

func (*ContainerHandler) ListContainerTemplate

func (h *ContainerHandler) ListContainerTemplate(c *gin.Context)

ListContainerTemplate godoc @Summary 容器模板列表 @Description 查询 ContainerTemplate 列表 @Tags 容器管理 @Produce json @Success 200 {array} types.ContainerTemplate @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template/list [get]

func (*ContainerHandler) ListRuntimeMonitoringSnapshot

func (h *ContainerHandler) ListRuntimeMonitoringSnapshot(c *gin.Context)

ListRuntimeMonitoringSnapshot godoc @Summary 运行时监控快照 @Description 返回全局运行时监控表快照(runtime_id 与引用计数) @Tags 容器管理 @Produce json @Success 200 {object} map[string]interface{} @Failure 401 {object} errors.AppError @Security Bearer @Router /container/runtime/monitoring/list [get]

func (*ContainerHandler) PageAppSession

func (h *ContainerHandler) PageAppSession(c *gin.Context)

PageAppSession godoc @Summary 分页查询应用会话 @Description 按当前用户分页查询 AppSession 列表 @Tags 容器管理 @Accept json @Produce json @Param request body appSessionPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/list-by-page [post]

func (*ContainerHandler) PageContainerImage

func (h *ContainerHandler) PageContainerImage(c *gin.Context)

PageContainerImage godoc @Summary 分页查询容器镜像 @Description 分页查询 ContainerImage 列表 @Tags 容器管理 @Accept json @Produce json @Param request body containerImagePageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/image/list-by-page [post]

func (*ContainerHandler) PageContainerInstance

func (h *ContainerHandler) PageContainerInstance(c *gin.Context)

PageContainerInstance godoc @Summary 分页查询容器实例 @Description 分页查询 ContainerInstance 列表 @Tags 容器管理 @Accept json @Produce json @Param request body containerInstancePageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/instance/list-by-page [post]

func (*ContainerHandler) PageContainerTemplate

func (h *ContainerHandler) PageContainerTemplate(c *gin.Context)

PageContainerTemplate godoc @Summary 分页查询容器模板 @Description 分页查询 ContainerTemplate 列表 @Tags 容器管理 @Accept json @Produce json @Param request body containerTemplatePageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template/list-by-page [post]

func (*ContainerHandler) PageOutboxEvent

func (h *ContainerHandler) PageOutboxEvent(c *gin.Context)

PageOutboxEvent godoc @Summary 分页查询事件出箱 @Description 分页查询 OutboxEvent 列表 @Tags 容器管理 @Accept json @Produce json @Param request body outboxEventPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/outbox/list-by-page [post]

func (*ContainerHandler) RecreateAppSessionContainer

func (h *ContainerHandler) RecreateAppSessionContainer(c *gin.Context)

RecreateAppSessionContainer godoc @Summary 重建应用会话容器 @Description 不创建 AppSession,删除并重新创建 AppSession 对应的容器实例 @Tags 容器管理 @Accept json @Produce json @Param request body appSessionIDBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/recreate-container [post]

func (*ContainerHandler) StartAppSession

func (h *ContainerHandler) StartAppSession(c *gin.Context)

StartAppSession godoc @Summary 启动应用会话 @Description 通过 ContainerManager 启动 AppSession 绑定容器 @Tags 容器管理 @Accept json @Produce json @Param request body appSessionIDBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/start [post]

func (*ContainerHandler) StopAppSession

func (h *ContainerHandler) StopAppSession(c *gin.Context)

StopAppSession godoc @Summary 停止应用会话 @Description 通过 ContainerManager 停止 AppSession 绑定容器 @Tags 容器管理 @Accept json @Produce json @Param request body appSessionIDBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/app-session/stop [post]

func (*ContainerHandler) UpdateContainerImage

func (h *ContainerHandler) UpdateContainerImage(c *gin.Context)

UpdateContainerImage godoc @Summary 更新容器镜像 @Description 按 ID 更新 ContainerImage 记录 @Tags 容器管理 @Accept json @Produce json @Param request body types.ContainerImage true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/image/update [post]

func (*ContainerHandler) UpdateContainerTemplate

func (h *ContainerHandler) UpdateContainerTemplate(c *gin.Context)

UpdateContainerTemplate godoc @Summary 更新容器模板 @Description 按 ID 更新 ContainerTemplate 记录(手动校验 ImageID,不使用 GORM 关系维护) @Tags 容器管理 @Accept json @Produce json @Param request body types.ContainerTemplate true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template/update [post]

type DataHandler

type DataHandler struct {
	// contains filtered or unexported fields
}

func NewDataHandler

func NewDataHandler(dataService interfaces.DataService, projectService interfaces.ProjectService) *DataHandler

func (*DataHandler) AddFileToDataset

func (h *DataHandler) AddFileToDataset(c *gin.Context)

AddFileToDataset godoc @Summary 按路径添加文件到数据集 @Description 根据 BaseDir + path 检查文件是否存在,创建 File 记录并关联到 Dataset @Tags 数据管理 @Accept json @Produce json @Param request body types.AddFileToDatasetRequest true "请求参数" @Success 200 {object} types.AddFileToDatasetResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-file/add-file [post]

func (*DataHandler) CreateDataset

func (h *DataHandler) CreateDataset(c *gin.Context)

CreateDataset godoc @Summary 创建数据集 @Description 创建 Dataset 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.Dataset true "请求参数" @Success 200 {object} types.Dataset @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset/create [post]

func (*DataHandler) CreateDatasetFile

func (h *DataHandler) CreateDatasetFile(c *gin.Context)

CreateDatasetFile godoc @Summary 创建数据集-文件映射 @Description 创建 DatasetFile 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.DatasetFile true "请求参数" @Success 200 {object} types.DatasetFile @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-file/create [post]

func (*DataHandler) CreateDatasetSample

func (h *DataHandler) CreateDatasetSample(c *gin.Context)

CreateDatasetSample godoc @Summary 创建数据集-样本映射 @Description 创建 DatasetSample 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.DatasetSample true "请求参数" @Success 200 {object} types.DatasetSample @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-sample/create [post]

func (*DataHandler) CreateFile

func (h *DataHandler) CreateFile(c *gin.Context)

CreateFile godoc @Summary 创建文件 @Description 创建 File 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.File true "请求参数" @Success 200 {object} types.File @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/create [post]

func (*DataHandler) CreateProjectDataset

func (h *DataHandler) CreateProjectDataset(c *gin.Context)

CreateProjectDataset godoc @Summary 创建项目-数据集映射 @Description 创建 ProjectDataset 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.ProjectDataset true "请求参数" @Success 200 {object} types.ProjectDataset @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/project-dataset/create [post]

func (*DataHandler) CreateSample

func (h *DataHandler) CreateSample(c *gin.Context)

CreateSample godoc @Summary 创建样本 @Description 创建 Sample 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.Sample true "请求参数" @Success 200 {object} types.Sample @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample/create [post]

func (*DataHandler) CreateSampleFile

func (h *DataHandler) CreateSampleFile(c *gin.Context)

CreateSampleFile godoc @Summary 创建样本-文件映射 @Description 创建 SampleFile 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.SampleFile true "请求参数" @Success 200 {object} types.SampleFile @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample-file/create [post]

func (*DataHandler) DeleteDataset

func (h *DataHandler) DeleteDataset(c *gin.Context)

DeleteDataset godoc @Summary 删除数据集 @Description 按 ID 删除 Dataset,并手动清理关联映射关系 @Tags 数据管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset/delete [post]

func (*DataHandler) DeleteDatasetFile

func (h *DataHandler) DeleteDatasetFile(c *gin.Context)

DeleteDatasetFile godoc @Summary 删除数据集-文件映射 @Description 按 ID 删除 DatasetFile 记录 @Tags 数据管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-file/delete [post]

func (*DataHandler) DeleteDatasetSample

func (h *DataHandler) DeleteDatasetSample(c *gin.Context)

DeleteDatasetSample godoc @Summary 删除数据集-样本映射 @Description 按 ID 删除 DatasetSample 记录 @Tags 数据管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-sample/delete [post]

func (*DataHandler) DeleteFile

func (h *DataHandler) DeleteFile(c *gin.Context)

DeleteFile godoc @Summary 删除文件 @Description 按 ID 删除 File,并手动清理关联映射关系 @Tags 数据管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/delete [post]

func (*DataHandler) DeleteProjectDataset

func (h *DataHandler) DeleteProjectDataset(c *gin.Context)

DeleteProjectDataset godoc @Summary 删除项目-数据集映射 @Description 按 ID 删除 ProjectDataset 记录 @Tags 数据管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/project-dataset/delete [post]

func (*DataHandler) DeleteSample

func (h *DataHandler) DeleteSample(c *gin.Context)

DeleteSample godoc @Summary 删除样本 @Description 按 ID 删除 Sample,并手动清理关联映射关系 @Tags 数据管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample/delete [post]

func (*DataHandler) DeleteSampleFile

func (h *DataHandler) DeleteSampleFile(c *gin.Context)

DeleteSampleFile godoc @Summary 删除样本-文件映射 @Description 按 ID 删除 SampleFile 记录 @Tags 数据管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample-file/delete [post]

func (*DataHandler) GetDataset

func (h *DataHandler) GetDataset(c *gin.Context)

GetDataset godoc @Summary 获取数据集 @Description 按 ID 查询 Dataset 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.Dataset @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset/get [get]

func (*DataHandler) GetDatasetFile

func (h *DataHandler) GetDatasetFile(c *gin.Context)

GetDatasetFile godoc @Summary 获取数据集-文件映射 @Description 按 ID 查询 DatasetFile 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.DatasetFile @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-file/get [get]

func (*DataHandler) GetDatasetSample

func (h *DataHandler) GetDatasetSample(c *gin.Context)

GetDatasetSample godoc @Summary 获取数据集-样本映射 @Description 按 ID 查询 DatasetSample 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.DatasetSample @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-sample/get [get]

func (*DataHandler) GetFile

func (h *DataHandler) GetFile(c *gin.Context)

GetFile godoc @Summary 获取文件 @Description 按 ID 查询 File 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.File @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/get [get]

func (*DataHandler) GetProjectDataset

func (h *DataHandler) GetProjectDataset(c *gin.Context)

GetProjectDataset godoc @Summary 获取项目-数据集映射 @Description 按 ID 查询 ProjectDataset 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.ProjectDataset @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/project-dataset/get [get]

func (*DataHandler) GetSample

func (h *DataHandler) GetSample(c *gin.Context)

GetSample godoc @Summary 获取样本 @Description 按 ID 查询 Sample 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.Sample @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample/get [get]

func (*DataHandler) GetSampleFile

func (h *DataHandler) GetSampleFile(c *gin.Context)

GetSampleFile godoc @Summary 获取样本-文件映射 @Description 按 ID 查询 SampleFile 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.SampleFile @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample-file/get [get]

func (*DataHandler) ListDataset

func (h *DataHandler) ListDataset(c *gin.Context)

ListDataset godoc @Summary 数据集列表 @Description 查询 Dataset 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.Dataset @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset/list [get]

func (*DataHandler) ListDatasetFile

func (h *DataHandler) ListDatasetFile(c *gin.Context)

ListDatasetFile godoc @Summary 数据集-文件映射列表 @Description 查询 DatasetFile 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.DatasetFile @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-file/list [get]

func (*DataHandler) ListDatasetSample

func (h *DataHandler) ListDatasetSample(c *gin.Context)

ListDatasetSample godoc @Summary 数据集-样本映射列表 @Description 查询 DatasetSample 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.DatasetSample @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-sample/list [get]

func (*DataHandler) ListFile

func (h *DataHandler) ListFile(c *gin.Context)

ListFile godoc @Summary 文件列表 @Description 查询 File 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.File @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/list [get]

func (*DataHandler) ListFileByProjectID

func (h *DataHandler) ListFileByProjectID(c *gin.Context)

ListFileByProjectID godoc @Summary 按项目查询文件列表 @Description 根据 project_id 查询关联的所有文件;支持按 go_dataset_file.role 过滤 @Tags 数据管理 @Produce json @Param project_id query string true "项目业务ID" @Param role query []string false "角色过滤,可多选;不传默认查询全部" collectionFormat(multi) @Success 200 {array} types.FileWithDatasetInfo @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/list-by-project [get]

func (*DataHandler) ListFileByProjectIDGroupByRole

func (h *DataHandler) ListFileByProjectIDGroupByRole(c *gin.Context)

ListFileByProjectIDGroupByRole godoc @Summary 按项目查询文件列表并按角色分组 @Description 根据 project_id 查询关联文件,并按 role 分组 @Tags 数据管理 @Produce json @Param project_id query string true "项目业务ID" @Success 200 {object} map[string][]types.FileWithDatasetInfo @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/list-by-project-group [get]

func (*DataHandler) ListProjectDataset

func (h *DataHandler) ListProjectDataset(c *gin.Context)

ListProjectDataset godoc @Summary 项目-数据集映射列表 @Description 查询 ProjectDataset 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.ProjectDataset @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/project-dataset/list [get]

func (*DataHandler) ListSample

func (h *DataHandler) ListSample(c *gin.Context)

ListSample godoc @Summary 样本列表 @Description 查询 Sample 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.Sample @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample/list [get]

func (*DataHandler) ListSampleByProjectID

func (h *DataHandler) ListSampleByProjectID(c *gin.Context)

ListSampleByProjectID godoc @Summary 按项目查询样本列表 @Description 根据 project_id 查询关联的所有样本 @Tags 数据管理 @Produce json @Param project_id query string true "项目业务ID" @Success 200 {array} types.SampleWithDatasetInfo @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample/list-by-project [get]

func (*DataHandler) ListSampleFile

func (h *DataHandler) ListSampleFile(c *gin.Context)

ListSampleFile godoc @Summary 样本-文件映射列表 @Description 查询 SampleFile 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.SampleFile @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample-file/list [get]

func (*DataHandler) PageDatasetByProjectID

func (h *DataHandler) PageDatasetByProjectID(c *gin.Context)

PageDatasetByProjectID godoc @Summary 按项目分页查询数据集 @Description 根据 project_id 分页查询关联的 Dataset 列表 @Tags 数据管理 @Accept json @Produce json @Param request body datasetByProjectPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset/list-by-project-page [post]

func (*DataHandler) PageFileByProjectID

func (h *DataHandler) PageFileByProjectID(c *gin.Context)

PageFileByProjectID godoc @Summary 按项目分页查询文件 @Description 根据 project_id 分页查询项目下关联文件,并返回 role、dataset_name、dataset_id 等信息 @Tags 数据管理 @Accept json @Produce json @Param request body projectFilePageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/list-by-project-page [post]

func (*DataHandler) PageSampleByProjectID

func (h *DataHandler) PageSampleByProjectID(c *gin.Context)

PageSampleByProjectID godoc @Summary 按项目分页查询样本 @Description 根据 project_id 分页查询项目下关联样本,并返回 dataset_name、dataset_id 等信息 @Tags 数据管理 @Accept json @Produce json @Param request body sampleByProjectPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample/list-by-project-page [post]

func (*DataHandler) UpdateDataset

func (h *DataHandler) UpdateDataset(c *gin.Context)

UpdateDataset godoc @Summary 更新数据集 @Description 按 ID 更新 Dataset 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.Dataset true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset/update [post]

func (*DataHandler) UpdateDatasetFile

func (h *DataHandler) UpdateDatasetFile(c *gin.Context)

UpdateDatasetFile godoc @Summary 更新数据集-文件映射 @Description 根据 DatasetID + FileID 更新 DatasetFile 的 Role 字段 @Tags 数据管理 @Accept json @Produce json @Param request body types.UpdateDatasetFileRequest true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-file/update [post]

func (*DataHandler) UpdateDatasetSample

func (h *DataHandler) UpdateDatasetSample(c *gin.Context)

UpdateDatasetSample godoc @Summary 更新数据集-样本映射 @Description 按 ID 更新 DatasetSample 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.DatasetSample true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-sample/update [post]

func (*DataHandler) UpdateFile

func (h *DataHandler) UpdateFile(c *gin.Context)

UpdateFile godoc @Summary 更新文件 @Description 按 ID 更新 File 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.File true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/update [post]

func (*DataHandler) UpdateProjectDataset

func (h *DataHandler) UpdateProjectDataset(c *gin.Context)

UpdateProjectDataset godoc @Summary 更新项目-数据集映射 @Description 按 ID 更新 ProjectDataset 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.ProjectDataset true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/project-dataset/update [post]

func (*DataHandler) UpdateSample

func (h *DataHandler) UpdateSample(c *gin.Context)

UpdateSample godoc @Summary 更新样本 @Description 按 ID 更新 Sample 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.Sample true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample/update [post]

func (*DataHandler) UpdateSampleFile

func (h *DataHandler) UpdateSampleFile(c *gin.Context)

UpdateSampleFile godoc @Summary 更新样本-文件映射 @Description 按 ID 更新 SampleFile 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.SampleFile true "请求参数" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/sample-file/update [post]

type EditNodeParamsResponse

type EditNodeParamsResponse struct {
	AnalysisName   string                 `json:"analysis_name"`
	IsReport       bool                   `json:"is_report"`
	CacheType      int                    `json:"cache_type"`
	AnalysisID     int64                  `json:"analysis_id,string"`
	AnalysisNodeID string                 `json:"analysis_node_id"`
	Status         string                 `json:"status"`
	ServerStatus   string                 `json:"server_status"`
	RequestParam   map[string]interface{} `json:"request_param"`
	AnalysisResult map[string]interface{} `json:"analysis_result"`
	FormJSON       []interface{}          `json:"formJson"`
}

type EditParamsV2Response

type EditParamsV2Response struct {
	AnalysisName   string                 `json:"analysis_name"`
	IsReport       bool                   `json:"is_report"`
	CacheType      int                    `json:"cache_type"`
	AnalysisID     string                 `json:"analysis_id"`
	Status         string                 `json:"status"`
	ServerStatus   string                 `json:"server_status"`
	RequestParam   map[string]interface{} `json:"request_param"`
	AnalysisResult map[string]interface{} `json:"analysis_result"`
	FormJSON       []interface{}          `json:"formJson"`
}

type FileHandler

type FileHandler struct {
	// contains filtered or unexported fields
}

func NewFileHandler

func NewFileHandler(cfg *config.Config, projectService interfaces.ProjectService) *FileHandler

func (*FileHandler) CreateDir

func (h *FileHandler) CreateDir(c *gin.Context)

func (*FileHandler) CreateFile

func (h *FileHandler) CreateFile(c *gin.Context)

func (*FileHandler) Delete

func (h *FileHandler) Delete(c *gin.Context)

func (*FileHandler) Download

func (h *FileHandler) Download(c *gin.Context)

func (*FileHandler) ListProjectDir

func (h *FileHandler) ListProjectDir(c *gin.Context)

func (*FileHandler) Move

func (h *FileHandler) Move(c *gin.Context)

func (*FileHandler) Search

func (h *FileHandler) Search(c *gin.Context)

func (*FileHandler) Upload

func (h *FileHandler) Upload(c *gin.Context)

type LLMHandler

type LLMHandler struct {
	// contains filtered or unexported fields
}

func NewLLMHandler

func NewLLMHandler(hub *realtime.Hub, cfg *config.Config, projectSvc interfaces.ProjectService,
	llmSvc interfaces.LLMService,
	workflowSvc interfaces.WorkflowService,
	analsyisSvc interfaces.AnalysisService,
	nodeOrchestrator interfaces.NodeOrchestrator,
	agentClient *agent.Client,
	runtimeCtx *RuntimeContextResolver,
) *LLMHandler

func (*LLMHandler) CreateLLMConversation

func (h *LLMHandler) CreateLLMConversation(c *gin.Context)

func (*LLMHandler) CreateLLMSession

func (h *LLMHandler) CreateLLMSession(c *gin.Context)

func (*LLMHandler) DeleteLLMConversation

func (h *LLMHandler) DeleteLLMConversation(c *gin.Context)

func (*LLMHandler) DeleteLLMSession

func (h *LLMHandler) DeleteLLMSession(c *gin.Context)

func (*LLMHandler) GetLLMConversation

func (h *LLMHandler) GetLLMConversation(c *gin.Context)

func (*LLMHandler) GetLLMSession

func (h *LLMHandler) GetLLMSession(c *gin.Context)

func (*LLMHandler) ListLLMConversation

func (h *LLMHandler) ListLLMConversation(c *gin.Context)

func (*LLMHandler) ListLLMSession

func (h *LLMHandler) ListLLMSession(c *gin.Context)

func (*LLMHandler) UpdateLLMConversation

func (h *LLMHandler) UpdateLLMConversation(c *gin.Context)

func (*LLMHandler) UpdateLLMSession

func (h *LLMHandler) UpdateLLMSession(c *gin.Context)

type ProjectHandler

type ProjectHandler struct {
	// contains filtered or unexported fields
}

func NewProjectHandler

func NewProjectHandler(projectService interfaces.ProjectService) *ProjectHandler

func (*ProjectHandler) ActivateProject

func (h *ProjectHandler) ActivateProject(c *gin.Context)

ActivateProject godoc @Summary 激活当前用户项目 @Description 按项目ID激活当前用户的项目,并将该用户其他项目全部置为未激活 @Tags 项目 @Accept json @Produce json @Param request body activateProjectRequest true "请求参数" @Success 200 {object} map[string]string "激活成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "项目未关联当前用户" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/activate-project [post]

func (*ProjectHandler) AddLiterature added in v0.1.2

func (h *ProjectHandler) AddLiterature(c *gin.Context)

AddLiterature godoc @Summary 为激活项目添加文献 @Description 创建一条参考文献记录并绑定到当前用户激活项目,全文按 content_source 存储(默认写入文件) @Tags 项目 @Accept json @Produce json @Param request body addLiteratureRequest true "请求参数" @Success 200 {object} types.Literature "创建成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "未找到激活项目" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/add-literature [post]

func (*ProjectHandler) AddProjectReport

func (h *ProjectHandler) AddProjectReport(c *gin.Context)

AddProjectReport godoc @Summary 添加项目报告 @Description 向指定项目添加报告记录 @Tags 项目 @Accept json @Produce json @Param request body addProjectReportRequest true "请求参数" @Success 200 {object} types.ProjectReport "创建成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "项目未关联当前用户" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/add-project-report [post]

func (*ProjectHandler) AddProjectToUser

func (h *ProjectHandler) AddProjectToUser(c *gin.Context)

AddProjectToUser godoc @Summary 按用户ID关联用户与项目 @Description 将指定用户与指定项目关联(写入 user_project 中间表),用户ID由请求传入 @Tags 项目 @Accept json @Produce json @Param request body addProjectToUserRequest true "请求参数" @Success 200 {object} map[string]string "关联成功" @Failure 400 {object} errors.AppError "参数错误或已存在关联" @Failure 401 {object} errors.AppError "未认证" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/add-project-to-user [post]

func (*ProjectHandler) AddUserProject

func (h *ProjectHandler) AddUserProject(c *gin.Context)

AddUserProject godoc @Summary 通过分享码关联用户与项目 @Description 根据分享码查找项目,并将当前登录用户与该项目关联(写入 user_project 中间表) @Tags 项目 @Accept json @Produce json @Param request body addUserProjectRequest true "请求参数" @Success 200 {object} map[string]string "关联成功" @Failure 400 {object} errors.AppError "参数错误、分享码无效或已存在关联" @Failure 401 {object} errors.AppError "未认证" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/add-user-project [post]

func (*ProjectHandler) BindLiterature added in v0.1.2

func (h *ProjectHandler) BindLiterature(c *gin.Context)

BindLiterature godoc @Summary 绑定文献到激活项目 @Description 将已存在的文献绑定到当前用户激活项目(写入 project_literature 中间表) @Tags 项目 @Accept json @Produce json @Param request body bindLiteratureRequest true "请求参数" @Success 200 {object} map[string]string "绑定成功" @Failure 400 {object} errors.AppError "参数错误或已绑定" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "文献或激活项目不存在" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/bind-literature [post]

func (*ProjectHandler) CreateProject

func (h *ProjectHandler) CreateProject(c *gin.Context)

CreateProject godoc @Summary 为当前用户创建项目 @Description 创建一个新项目并将其关联到当前登录用户,同时将该用户其他项目置为非激活 @Tags 项目 @Accept json @Produce json @Param request body createProjectRequest true "请求参数" @Success 200 {object} projectListItem "创建成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/create-project [post]

func (*ProjectHandler) DeleteLiterature added in v0.1.2

func (h *ProjectHandler) DeleteLiterature(c *gin.Context)

DeleteLiterature godoc @Summary 删除文献 @Description 按文献ID删除文献记录、全文文件及其所有项目关联 @Tags 项目 @Accept json @Produce json @Param request body deleteLiteratureRequest true "请求参数" @Success 200 {object} map[string]string "删除成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "文献不存在或未绑定当前激活项目" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/delete-literature [post]

func (*ProjectHandler) DeleteProjectReport

func (h *ProjectHandler) DeleteProjectReport(c *gin.Context)

DeleteProjectReport godoc @Summary 删除项目报告 @Description 按报告ID删除指定项目下的报告 @Tags 项目 @Accept json @Produce json @Param request body deleteProjectReportRequest true "请求参数" @Success 200 {object} map[string]string "删除成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "项目或报告不存在" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/delete-project-report [post]

func (*ProjectHandler) DeleteUserProject

func (h *ProjectHandler) DeleteUserProject(c *gin.Context)

DeleteUserProject godoc @Summary 删除用户与项目关联 @Description 根据当前登录用户与项目ID删除 user_project 中间表记录,仅当该关联为非激活状态时允许删除 @Tags 项目 @Accept json @Produce json @Param request body deleteUserProjectRequest true "请求参数" @Success 200 {object} map[string]string "删除成功" @Failure 400 {object} errors.AppError "参数错误或关联仍为激活状态" @Failure 404 {object} errors.AppError "关联不存在" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/delete-user-project [post]

func (*ProjectHandler) GetActiveProject

func (h *ProjectHandler) GetActiveProject(c *gin.Context)

GetActiveProject godoc @Summary 获取当前用户激活项目 @Description 返回当前登录用户唯一激活的项目 @Tags 项目 @Produce json @Success 200 {object} projectListItem "激活项目" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "未找到激活项目" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/active-project [get]

func (*ProjectHandler) GetLiteratureDetail added in v0.1.2

func (h *ProjectHandler) GetLiteratureDetail(c *gin.Context)

GetLiteratureDetail godoc @Summary 查询文献详情 @Description 根据 id 查询文献详情(包含全文 content) @Tags 项目 @Produce json @Param id query int64 true "文献ID" @Success 200 {object} literatureDetailItem "文献详情" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "文献不存在或未绑定当前激活项目" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/literature-detail [get]

func (*ProjectHandler) GetProjectReportDetail

func (h *ProjectHandler) GetProjectReportDetail(c *gin.Context)

GetProjectReportDetail godoc @Summary 查询项目报告详情 @Description 根据 id 查询报告详情(包含 content) @Tags 项目 @Produce json @Param id query int64 true "报告ID" @Success 200 {object} projectReportDetailItem "报告详情" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "项目未关联当前用户" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/project-report-detail [get]

func (*ProjectHandler) ListLiterature added in v0.1.2

func (h *ProjectHandler) ListLiterature(c *gin.Context)

ListLiterature godoc @Summary 查询激活项目文献列表 @Description 查询当前用户激活项目绑定的文献列表,不返回 content 字段 @Tags 项目 @Produce json @Success 200 {array} literatureListItem "文献列表" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "未找到激活项目" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/list-literature [get]

func (*ProjectHandler) ListProject

func (h *ProjectHandler) ListProject(c *gin.Context)

ListProject godoc @Summary 获取当前用户的项目列表 @Description 返回与当前登录用户关联的所有项目(通过 user_project 关系表过滤) @Tags 项目 @Produce json @Success 200 {array} projectListItem "项目列表" @Failure 401 {object} errors.AppError "未认证" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/list-project [get]

func (*ProjectHandler) ListProjectReport

func (h *ProjectHandler) ListProjectReport(c *gin.Context)

ListProjectReport godoc @Summary 查询项目报告列表 @Description 查询当前用户激活项目的报告列表,不返回 content 字段,按 sort_order、created_at 升序排序 @Tags 项目 @Produce json @Success 200 {array} projectReportListItem "报告列表" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "未找到激活项目" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/list-project-report [get]

func (*ProjectHandler) PageLiterature added in v0.1.2

func (h *ProjectHandler) PageLiterature(c *gin.Context)

PageLiterature godoc @Summary 分页查询激活项目文献列表 @Description 按当前用户激活项目分页查询文献列表,不返回 content 字段 @Tags 项目 @Accept json @Produce json @Param request body handler.literaturePageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /project/list-literature-page [post]

func (*ProjectHandler) PageLiteraturePool added in v0.1.2

func (h *ProjectHandler) PageLiteraturePool(c *gin.Context)

PageLiteraturePool godoc @Summary 分页查询文献池 @Description 分页查询所有文献并标记是否已绑定当前用户激活项目,用于绑定文献选择 @Tags 项目 @Accept json @Produce json @Param request body handler.literaturePageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /project/list-literature-pool-page [post]

func (*ProjectHandler) PageProjectReport

func (h *ProjectHandler) PageProjectReport(c *gin.Context)

PageProjectReport godoc @Summary 分页查询项目报告列表 @Description 按当前用户激活项目分页查询报告列表,不返回 content 字段,按 sort_order 降序、created_at 升序排序 @Tags 项目 @Accept json @Produce json @Param request body handler.projectReportPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /project/list-project-report-page [post]

func (*ProjectHandler) UnbindLiterature added in v0.1.2

func (h *ProjectHandler) UnbindLiterature(c *gin.Context)

UnbindLiterature godoc @Summary 移除激活项目中的文献 @Description 删除当前用户激活项目与文献的关联(仅删除 project_literature 中间表记录) @Tags 项目 @Accept json @Produce json @Param request body unbindLiteratureRequest true "请求参数" @Success 200 {object} map[string]string "移除成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "关联不存在" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/unbind-literature [post]

func (*ProjectHandler) UpdateLiterature added in v0.1.2

func (h *ProjectHandler) UpdateLiterature(c *gin.Context)

UpdateLiterature godoc @Summary 更新文献 @Description 按文献ID更新标题、全文内容与存储方式 @Tags 项目 @Accept json @Produce json @Param request body updateLiteratureRequest true "请求参数" @Success 200 {object} map[string]string "更新成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "文献不存在或未绑定当前激活项目" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/update-literature [post]

func (*ProjectHandler) UpdateProjectReport

func (h *ProjectHandler) UpdateProjectReport(c *gin.Context)

UpdateProjectReport godoc @Summary 更新项目报告 @Description 按报告ID更新指定项目下的报告 @Tags 项目 @Accept json @Produce json @Param request body updateProjectReportRequest true "请求参数" @Success 200 {object} map[string]string "更新成功" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "项目或报告不存在" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/update-project-report [post]

func (*ProjectHandler) UpdateProjectSharing

func (h *ProjectHandler) UpdateProjectSharing(c *gin.Context)

UpdateProjectSharing godoc @Summary 开启或关闭项目分享 @Description 开启分享时生成分享码并返回;关闭分享时清空分享码 @Tags 项目 @Accept json @Produce json @Param request body updateProjectSharingRequest true "请求参数" @Success 200 {object} map[string]interface{} "分享状态与分享码" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "项目未关联当前用户" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /project/update-project-sharing [post]

type ProxyHandler

type ProxyHandler struct {
	// contains filtered or unexported fields
}

func NewProxyHandler

func NewProxyHandler(cfg *config.Config, registry route.RouteRegistry) (*ProxyHandler, error)

func (*ProxyHandler) AppSessionProxy

func (h *ProxyHandler) AppSessionProxy(c *gin.Context)

func (*ProxyHandler) BraveAPIProxy

func (h *ProxyHandler) BraveAPIProxy(c *gin.Context)

func (*ProxyHandler) ContainerProxy

func (h *ProxyHandler) ContainerProxy(c *gin.Context)

func (*ProxyHandler) FallbackProxy

func (h *ProxyHandler) FallbackProxy(c *gin.Context)

func (*ProxyHandler) OnlyOfficeProxy

func (h *ProxyHandler) OnlyOfficeProxy(c *gin.Context)

type PublishScriptRequest

type PublishScriptRequest struct {
	ScriptID int64  `json:"script_id,string"`
	Url      string `json:"url"`
	Version  string `json:"version"`
	Message  string `json:"message"`
}

type PublishWorkflowRequest

type PublishWorkflowRequest struct {
	WorkflowID int64  `json:"workflow_id,string"`
	Url        string `json:"url"`
	Version    string `json:"version"`
	Message    string `json:"message"`
}

type RealtimeHandler

type RealtimeHandler struct {
	// contains filtered or unexported fields
}

func NewRealtimeHandler

func NewRealtimeHandler(hub *realtime.Hub, cfg *config.Config) *RealtimeHandler

func (*RealtimeHandler) Connect

func (h *RealtimeHandler) Connect(c *gin.Context)

func (*RealtimeHandler) ConnectSSE

func (h *RealtimeHandler) ConnectSSE(c *gin.Context)

func (*RealtimeHandler) ConnectWS

func (h *RealtimeHandler) ConnectWS(c *gin.Context)

func (*RealtimeHandler) Push

func (h *RealtimeHandler) Push(c *gin.Context)

func (*RealtimeHandler) Stats

func (h *RealtimeHandler) Stats(c *gin.Context)

type RunAnalysisNodeToolParams

type RunAnalysisNodeToolParams struct {
	AnalysisNodeID string `json:"analysis_node_id" jsonschema:"The analysis node ID to run, as a string to preserve precision"`
	TimeoutSeconds int    `json:"timeout_seconds" jsonschema:"Timeout seconds waiting for completion (default 600)"`
}

RunAnalysisNodeToolParams is the input for the run_analysis_node LLM tool.

type RunAnalysisNodeToolResult

type RunAnalysisNodeToolResult struct {
	AnalysisNodeID int64  `json:"analysis_node_id"`
	Status         string `json:"status"`
	Log            string `json:"log"`
	Success        bool   `json:"success"`
	Error          string `json:"error,omitempty"`
}

RunAnalysisNodeToolResult is the output returned to the LLM after the node finishes.

type RuntimeContext added in v0.1.2

type RuntimeContext struct {
	Type         string // 归一化后的业务类型(为空表示默认工作区)
	Label        string // 人类可读的上下文名称(如节点名 / 报告标题),用于前端展示
	SystemPrompt string // 注入给 Agent 的完整系统提示词
	WorkingDir   string // Agent 执行工作目录
}

RuntimeContext 是解析后的运行时上下文。

type RuntimeContextInfo added in v0.1.2

type RuntimeContextInfo struct {
	Type         string `json:"type"`                    // 归一化后的业务类型(空表示默认工作区)
	Label        string `json:"label"`                   // 人类可读的名称
	WorkingDir   string `json:"working_dir"`             // 工作目录
	SystemPrompt string `json:"system_prompt,omitempty"` // 系统提示词(仅在需要时返回)
}

RuntimeContextInfo 是用于前端展示的轻量上下文描述(不含 SystemPrompt)。

type RuntimeContextResolver added in v0.1.2

type RuntimeContextResolver struct {
	// contains filtered or unexported fields
}

RuntimeContextResolver 把「业务 env(type,id) → 系统提示词 + 工作目录」的解析逻辑 从具体 Handler 中抽离出来,供 LLM 桥接(LLMHandler)与 Agent 会话(AgentHandler) 两套调用链路复用,避免重复实现导致的行为漂移。

func NewRuntimeContextResolver added in v0.1.2

func NewRuntimeContextResolver(
	cfg *config.Config,
	projectSvc interfaces.ProjectService,
	workflowSvc interfaces.WorkflowService,
	analysisSvc interfaces.AnalysisService,
) *RuntimeContextResolver

NewRuntimeContextResolver 创建运行时上下文解析器。

func (*RuntimeContextResolver) Describe added in v0.1.2

func (r *RuntimeContextResolver) Describe(ctx context.Context, userID string, env map[string]any) (*RuntimeContextInfo, error)

Describe 解析 env 并返回用于前端展示的上下文描述。 与 Resolve 共享同一套解析逻辑,仅裁剪掉仅供 Agent 使用的 SystemPrompt。

func (*RuntimeContextResolver) Resolve added in v0.1.2

func (r *RuntimeContextResolver) Resolve(ctx context.Context, userID string, env map[string]any) (*RuntimeContext, error)

Resolve 根据 env 解析出系统提示词与工作目录。

env 为 nil 或 type 为空时,回退到当前用户激活项目的默认工作目录。

type SettingHandler

type SettingHandler struct {
	// contains filtered or unexported fields
}

func NewSettingHandler

func NewSettingHandler(cfg *config.Config) *SettingHandler

func (*SettingHandler) GetSetting

func (h *SettingHandler) GetSetting(c *gin.Context)

GetSetting godoc @Summary 获取系统设置 @Description 返回当前系统配置的容器运行时 @Tags 系统设置 @Produce json @Success 200 {object} getSettingResponse @Security Bearer @Router /setting/get-setting [get]

type SheetHandler

type SheetHandler struct {
	// contains filtered or unexported fields
}

func NewSheetHandler

func NewSheetHandler(sheetService interfaces.SheetFileService, dataService interfaces.DataService) *SheetHandler

func (*SheetHandler) ReadWorkbook

func (h *SheetHandler) ReadWorkbook(c *gin.Context)

ReadWorkbook godoc @Summary 读取本地工作簿 @Description 从本地文件读取工作簿并转换为 Univer 可用结构。当前优先支持 xlsx,csv/tsv 将在后续版本支持。 @Tags 表格 @Produce json @Param file_path query string true "本地文件路径(相对路径以 sheets 目录为根)" @Param format query string false "文件格式,可选:xlsx" @Success 200 {object} interfaces.WorkbookReadResult @Failure 400 {object} apperrors.AppError @Failure 401 {object} apperrors.AppError @Failure 404 {object} apperrors.AppError @Failure 500 {object} apperrors.AppError @Security Bearer @Router /sheet/workbook [get]

func (*SheetHandler) ReadWorkbookByFileID

func (h *SheetHandler) ReadWorkbookByFileID(c *gin.Context)

ReadWorkbookByFileID godoc @Summary 根据文件ID读取工作簿 @Description 根据 file_id 查找文件 path,再读取工作簿并转换为 Univer 可用结构。 @Tags 表格 @Produce json @Param file_id query string true "文件业务ID" @Param format query string false "文件格式,可选:xlsx" @Success 200 {object} interfaces.WorkbookReadResult @Failure 400 {object} apperrors.AppError @Failure 401 {object} apperrors.AppError @Failure 404 {object} apperrors.AppError @Failure 500 {object} apperrors.AppError @Security Bearer @Router /sheet/workbook/by-file-id [get]

func (*SheetHandler) WriteWorkbook

func (h *SheetHandler) WriteWorkbook(c *gin.Context)

WriteWorkbook godoc @Summary 保存工作簿到本地 @Description 将 Univer 工作簿结构写入本地文件。当前优先支持 xlsx,csv/tsv 将在后续版本支持。 @Tags 表格 @Accept json @Produce json @Param request body writeWorkbookRequest true "请求参数" @Success 200 {object} interfaces.WorkbookWriteResult @Failure 400 {object} apperrors.AppError @Failure 401 {object} apperrors.AppError @Failure 500 {object} apperrors.AppError @Security Bearer @Router /sheet/workbook/save [post]

func (*SheetHandler) WriteWorkbookByFileID

func (h *SheetHandler) WriteWorkbookByFileID(c *gin.Context)

WriteWorkbookByFileID godoc @Summary 根据文件ID保存工作簿 @Description 根据 file_id 查找文件 path,再将 Univer 工作簿结构写入本地文件。 @Tags 表格 @Accept json @Produce json @Param request body writeWorkbookByFileIDRequest true "请求参数" @Success 200 {object} interfaces.WorkbookWriteResult @Failure 400 {object} apperrors.AppError @Failure 401 {object} apperrors.AppError @Failure 404 {object} apperrors.AppError @Failure 500 {object} apperrors.AppError @Security Bearer @Router /sheet/workbook/save/by-file-id [post]

type StoreHandler

type StoreHandler struct {
	// contains filtered or unexported fields
}

func NewStoreHandler

func NewStoreHandler(storeService interfaces.StoreService, cfg *config.Config) *StoreHandler

func (*StoreHandler) CreateStore

func (h *StoreHandler) CreateStore(c *gin.Context)

func (*StoreHandler) DeleteStore

func (h *StoreHandler) DeleteStore(c *gin.Context)

func (*StoreHandler) DownloadStore

func (h *StoreHandler) DownloadStore(c *gin.Context)

func (*StoreHandler) GetStore

func (h *StoreHandler) GetStore(c *gin.Context)

func (*StoreHandler) GetStoreByStoreID

func (h *StoreHandler) GetStoreByStoreID(c *gin.Context)

func (*StoreHandler) ListStore

func (h *StoreHandler) ListStore(c *gin.Context)

func (*StoreHandler) PageStore

func (h *StoreHandler) PageStore(c *gin.Context)

func (*StoreHandler) ReDownloadStore

func (h *StoreHandler) ReDownloadStore(c *gin.Context)

func (*StoreHandler) UpdateStore

func (h *StoreHandler) UpdateStore(c *gin.Context)

type UploadHandler

type UploadHandler struct {
	// contains filtered or unexported fields
}

func NewUploadHandler

func NewUploadHandler(cfg *config.Config) *UploadHandler

func (*UploadHandler) UploadImage

func (h *UploadHandler) UploadImage(c *gin.Context)

UploadImage handles image file upload for project report markdown. @Summary 上传项目报告图片 @Description 上传图片并返回可直接用于 Markdown 的图片 URL @Tags 项目 @Accept mpfd @Produce json @Param file formData file true "图片文件" @Success 200 {object} map[string]interface{} "上传成功" @Failure 400 {object} appErrors.AppError "参数错误" @Failure 500 {object} appErrors.AppError "服务器错误" @Security Bearer @Router /project/upload-image [post]

type VisualizationNodeFileResponse

type VisualizationNodeFileResponse struct {
	Node         map[string]interface{}      `json:"node"`
	Result       VisualizationResultResponse `json:"result"`
	Status       string                      `json:"status"`
	ServerStatus string                      `json:"server_status"`
	UrlPrefix    string                      `json:"url_prefix"`
	Summaries    []*types.AISummary          `json:"summaries"`
}

type VisualizationNodeTreeItem

type VisualizationNodeTreeItem struct {
	ScriptID   string                `json:"script_id,string"`
	ScriptName string                `json:"script_name"`
	Children   []*types.AnalysisNode `json:"children"`
}

type VisualizationNodeTreeResponse

type VisualizationNodeTreeResponse struct {
	AnalysisID   string                      `json:"analysis_id"`
	AnalysisName string                      `json:"analysis_name"`
	RelationID   string                      `json:"relation_id"`
	Result       []VisualizationNodeTreeItem `json:"result"`
}

type VisualizationResultResponse

type VisualizationResultResponse struct {
	Images []map[string]interface{} `json:"images"`
	Tables []map[string]interface{} `json:"tables"`
	HTMLs  []map[string]interface{} `json:"htmls"`
	Files  []map[string]interface{} `json:"files"`
}

type WeatherParams

type WeatherParams struct {
	City string `json:"city" jsonschema:"The city name"`
}

Define the parameter type

type WeatherResult

type WeatherResult struct {
	City        string `json:"city"`
	Temperature string `json:"temperature"`
	Condition   string `json:"condition"`
}

Define the return type

type WorkflowFormJSONResponse

type WorkflowFormJSONResponse struct {
	Type     string        `json:"type"`
	FormJSON []interface{} `json:"formJson"`
}

type WorkflowFormResponse

type WorkflowFormResponse struct {
	Type           string                 `json:"type"`
	FormJSON       []interface{}          `json:"formJson"`
	AnalysisResult map[string]interface{} `json:"analysis_result"`
}

type WorkflowHandler

type WorkflowHandler struct {
	// contains filtered or unexported fields
}

func NewWorkflowHandler

func NewWorkflowHandler(workflowService interfaces.WorkflowService,
	containerService interfaces.ContainerService,
	dataService interfaces.DataService,
	projectService interfaces.ProjectService,
	storeService interfaces.StoreService, cfg *config.Config) *WorkflowHandler

func (*WorkflowHandler) DeleteScript

func (h *WorkflowHandler) DeleteScript(c *gin.Context)

DeleteScript godoc @Summary 删除脚本组件 @Description 按 scriptId 删除脚本;如果该脚本下存在 analysis_node 记录,或被某 workflow 的 dag_definition 引用,则拒绝删除 @Tags 工作流 @Produce json @Param scriptId path string true "脚本主键 ID" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 409 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /script/delete/{scriptId} [post]

func (*WorkflowHandler) DeleteWorkflow

func (h *WorkflowHandler) DeleteWorkflow(c *gin.Context)

DeleteWorkflow godoc @Summary 删除工作流 @Description 按 workflowId 删除工作流;如果该 workflow 下存在 analysis 记录则拒绝删除 @Tags 工作流 @Produce json @Param workflowId path string true "工作流 ID" @Success 200 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 409 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/delete/{workflowId} [post]

func (*WorkflowHandler) FindScript

func (h *WorkflowHandler) FindScript(c *gin.Context)

FindScript godoc @Summary 查询组件 @Description 查询 script:按主键 ID 查询并附带容器模板名称 @Tags 工作流 @Produce json @Param id path string true "Script 主键 ID" @Success 200 {object} map[string]any @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /find-script/{id} [get]

func (*WorkflowHandler) GenerateWorkflowJSON

func (h *WorkflowHandler) GenerateWorkflowJSON(c *gin.Context)

GenerateWorkflowJSON godoc @Summary 生成工作流 JSON @Description 根据 workflowId 读取工作流、脚本与 ContainerTemplateID,导出可落盘的 workflow.json @Tags 工作流 @Produce json @Param workflowId path string true "工作流 ID" @Success 200 {object} handler.WorkflowJSONExportResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/{workflowId}/generate-workflow-json [post]

func (*WorkflowHandler) GetFromJSONByWorlflow

func (h *WorkflowHandler) GetFromJSONByWorlflow(c *gin.Context)

GetFromJSONByRelationID godoc @Summary 获取工作流表单配置 @Description 根据 workflowId 解析工作流 DAG,聚合输入/参数/formJson 配置 @Tags 工作流 @Produce json @Param workflowId path string true "工作流 ID" @Success 200 {object} handler.WorkflowFormJSONResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/tools/get-from-json/{workflowId} [get]

func (*WorkflowHandler) GetScriptById

func (h *WorkflowHandler) GetScriptById(c *gin.Context)

GetScriptById godoc @Summary 根据 ID 获取脚本 @Description 根据主键 scriptId 查询脚本详情,附带 StoreVersion @Tags 工作流 @Produce json @Param scriptId path string true "脚本主键 ID" @Success 200 {object} types.ScriptVersion @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /script/{scriptId} [get]

func (*WorkflowHandler) GetScriptContent

func (h *WorkflowHandler) GetScriptContent(c *gin.Context)

GetScriptContent godoc @Summary 获取脚本文件内容 @Description 基于 scriptId 查询脚本主文件,返回绝对路径 path 与文件内容 content @Tags 工作流 @Produce json @Param scriptId path string true "脚本 ID" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /script/{scriptId}/content [get]

func (*WorkflowHandler) GetScriptForm

func (h *WorkflowHandler) GetScriptForm(c *gin.Context)

func (*WorkflowHandler) GetWorkflowById

func (h *WorkflowHandler) GetWorkflowById(c *gin.Context)

func (*WorkflowHandler) GetWorkflowForm

func (h *WorkflowHandler) GetWorkflowForm(c *gin.Context)

GetWorkflowForm godoc @Summary 获取工作流表单与分析数据 @Description 基于 workflowId 返回 formJson,并按 input_type 自动补充 analysis_result(sample 与按 role 分组的文件) @Tags 工作流 @Produce json @Param workflowId path string true "工作流 ID" @Success 200 {object} handler.WorkflowFormResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/{workflowId}/form [get]

func (*WorkflowHandler) GetWorkflowVis

func (h *WorkflowHandler) GetWorkflowVis(c *gin.Context)

GetWorkflowVis godoc @Summary 获取工作流可视化 DAG @Description 根据 workflowId 返回 DAG 可视化结构(包含 nodes/edges,并补充 script 视图字段) @Tags 工作流 @Produce json @Param workflowId path string true "工作流 ID" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /tools/get-workflow-vis/{workflowId} [get]

func (*WorkflowHandler) InstallScript

func (h *WorkflowHandler) InstallScript(c *gin.Context)

func (*WorkflowHandler) InstallWorkflow

func (h *WorkflowHandler) InstallWorkflow(c *gin.Context)

func (*WorkflowHandler) PageScript

func (h *WorkflowHandler) PageScript(c *gin.Context)

PageScript godoc @Summary 分页查询脚本组件 @Description 分页查询 script,支持 query 条件过滤与排序;后续扩展字段仅需新增 query 字段并补充仓储过滤逻辑 @Tags 工作流 @Accept json @Produce json @Param request body handler.pageScriptRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/page-script [post]

func (*WorkflowHandler) PageWorkflow

func (h *WorkflowHandler) PageWorkflow(c *gin.Context)

PageWorkflow godoc @Summary 分页查询工作流 @Description 分页查询 workflow,支持 query 条件过滤与排序;后续扩展字段仅需新增 query 字段并补充仓储过滤逻辑 @Tags 工作流 @Accept json @Produce json @Param request body handler.pageWorkflowRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/page-workflow [post]

func (*WorkflowHandler) PublishScript

func (h *WorkflowHandler) PublishScript(c *gin.Context)

func (*WorkflowHandler) PublishWorkflow

func (h *WorkflowHandler) PublishWorkflow(c *gin.Context)

func (*WorkflowHandler) SaveScript

func (h *WorkflowHandler) SaveScript(c *gin.Context)

SaveScript godoc @Summary 保存脚本组件 @Description 保存 script 组件:当请求包含 id 时更新记录,否则创建新记录 @Tags 工作流 @Accept json @Produce json @Param request body handler.createScriptRequest true "请求参数" @Success 200 {object} types.Script @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/save-script [post]

func (*WorkflowHandler) SaveWorkflow

func (h *WorkflowHandler) SaveWorkflow(c *gin.Context)

SaveWorkflow godoc @Summary 保存工作流 @Description 保存 workflow 组件:当请求包含 id 时更新记录,否则创建新记录 @Tags 工作流 @Accept json @Produce json @Param request body handler.createWorkflowRequest true "请求参数" @Success 200 {object} types.Workflow @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /workflow/save-workflow [post]

type WorkflowJSONExportResponse

type WorkflowJSONExportResponse struct {
	Path               string           `json:"path"`
	WorkflowID         string           `json:"workflow_id"`
	Workflow           map[string]any   `json:"workflow"`
	Scripts            []map[string]any `json:"scripts"`
	ContainerTemplates []map[string]any `json:"container_templates"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL