Documentation
¶
Index ¶
- Constants
- func GetDefaultIOSchame() string
- func GetInitScript(scriptType string) string
- func NewNodeRequestParser(dataService interfaces.DataService, workflowService interfaces.WorkflowService) dagruntime.NodeRequestParser
- func RegisterOnlyOfficeRoutes(r *gin.Engine, proxyHandler *ProxyHandler)
- func RegisterProjectDocsRoute(r *gin.Engine, cfg *config.Config, projectService interfaces.ProjectService)
- type AISummaryHandler
- func (h *AISummaryHandler) CreateAISummary(c *gin.Context)
- func (h *AISummaryHandler) DeleteAISummary(c *gin.Context)
- func (h *AISummaryHandler) GetAISummary(c *gin.Context)
- func (h *AISummaryHandler) GetAISummaryInput(c *gin.Context)
- func (h *AISummaryHandler) ListAISummary(c *gin.Context)
- func (h *AISummaryHandler) PageAISummaryByActiveProject(c *gin.Context)
- func (h *AISummaryHandler) RegenerateAISummary(c *gin.Context)
- func (h *AISummaryHandler) UpdateAISummary(c *gin.Context)
- type AgentHandler
- func (h *AgentHandler) AnswerQuestion(c *gin.Context)
- func (h *AgentHandler) ApprovePermission(c *gin.Context)
- func (h *AgentHandler) CancelTask(c *gin.Context)
- func (h *AgentHandler) Chat(c *gin.Context)
- func (h *AgentHandler) CreateTask(c *gin.Context)
- func (h *AgentHandler) DeleteMemory(c *gin.Context)
- func (h *AgentHandler) DeleteProfile(c *gin.Context)
- func (h *AgentHandler) DeleteSkill(c *gin.Context)
- func (h *AgentHandler) DenyPermission(c *gin.Context)
- func (h *AgentHandler) DescribeEnv(c *gin.Context)
- func (h *AgentHandler) GetMemory(c *gin.Context)
- func (h *AgentHandler) GetPendingPermissions(c *gin.Context)
- func (h *AgentHandler) GetPendingQuestions(c *gin.Context)
- func (h *AgentHandler) GetProfile(c *gin.Context)
- func (h *AgentHandler) GetSession(c *gin.Context)
- func (h *AgentHandler) GetSkill(c *gin.Context)
- func (h *AgentHandler) GetTask(c *gin.Context)
- func (h *AgentHandler) GetTaskRequest(c *gin.Context)
- func (h *AgentHandler) GetTaskTimeline(c *gin.Context)
- func (h *AgentHandler) ListProfiles(c *gin.Context)
- func (h *AgentHandler) ListSkills(c *gin.Context)
- func (h *AgentHandler) PageMemory(c *gin.Context)
- func (h *AgentHandler) PagePermissions(c *gin.Context)
- func (h *AgentHandler) PageQuestions(c *gin.Context)
- func (h *AgentHandler) PageSessions(c *gin.Context)
- func (h *AgentHandler) PageTasks(c *gin.Context)
- func (h *AgentHandler) ResolveSkill(c *gin.Context)
- func (h *AgentHandler) ResumeTask(c *gin.Context)
- func (h *AgentHandler) RetrieveMemory(c *gin.Context)
- func (h *AgentHandler) SaveMemory(c *gin.Context)
- func (h *AgentHandler) SaveProfile(c *gin.Context)
- func (h *AgentHandler) SaveSkill(c *gin.Context)
- func (h *AgentHandler) StartEventBridge()
- func (h *AgentHandler) StopEventBridge()
- type AnalysisHandler
- func (h *AnalysisHandler) AnalysisNodeLogs(c *gin.Context)
- func (h *AnalysisHandler) AnalysisNodeParams(c *gin.Context)
- func (h *AnalysisHandler) AnalysisNodeTerminal(c *gin.Context)
- func (h *AnalysisHandler) CreateCommandAnalysisNode(c *gin.Context)
- func (h *AnalysisHandler) DeleteAnalysis(c *gin.Context)
- func (h *AnalysisHandler) DeleteAnalysisNode(c *gin.Context)
- func (h *AnalysisHandler) EditNodeParams(c *gin.Context)
- func (h *AnalysisHandler) EditParamsV2(c *gin.Context)
- func (h *AnalysisHandler) GetAnalysisNode(c *gin.Context) *types.AnalysisNode
- func (h *AnalysisHandler) GetAnalysisNodeCommand(c *gin.Context)
- func (h *AnalysisHandler) ListAnalysisTree(c *gin.Context)
- func (h *AnalysisHandler) PageAnalysisByProject(c *gin.Context)
- func (h *AnalysisHandler) PageAnalysisNodeByProject(c *gin.Context)
- func (h *AnalysisHandler) ParseParams(c *gin.Context)
- func (h *AnalysisHandler) PublishProjectReportItemToDoc(c *gin.Context)
- func (h *AnalysisHandler) PublishProjectReportToDoc(c *gin.Context)
- func (h *AnalysisHandler) RunAnalysisNode(c *gin.Context)
- func (h *AnalysisHandler) RunAnalysisNodeByScriptID(c *gin.Context)
- func (h *AnalysisHandler) RunAnalysisNodeWithID(ctx context.Context, analsyisNodeId int64) error
- func (h *AnalysisHandler) RuntimeSnapshot(c *gin.Context)
- func (h *AnalysisHandler) SaveAnalysisController(c *gin.Context)
- func (h *AnalysisHandler) SaveAnalysisNodeControllerWithScript(c *gin.Context)
- func (h *AnalysisHandler) StopAnalysis(c *gin.Context)
- func (h *AnalysisHandler) StopAnalysisNode(c *gin.Context)
- func (h *AnalysisHandler) ToggleAnalysisReport(c *gin.Context)
- func (h *AnalysisHandler) UpdateAnalysisNodeCommand(c *gin.Context)
- func (h *AnalysisHandler) VisualizationNodeFile(c *gin.Context)
- func (h *AnalysisHandler) VisualizationNodeTree(c *gin.Context)
- type AnalysisNodeCommandResponse
- type AuthHandler
- func (h *AuthHandler) ChangePassword(c *gin.Context)
- func (h *AuthHandler) GetCurrentUser(c *gin.Context)
- func (h *AuthHandler) InitUser(ctx context.Context, user *types.User)
- func (h *AuthHandler) Login(c *gin.Context)
- func (h *AuthHandler) Logout(c *gin.Context)
- func (h *AuthHandler) RefreshToken(c *gin.Context)
- func (h *AuthHandler) Register(c *gin.Context)
- func (h *AuthHandler) UpdateAgentConfig(c *gin.Context)
- func (h *AuthHandler) UpdateAgentEnv(c *gin.Context)
- func (h *AuthHandler) UpdateBottomPanel(c *gin.Context)
- func (h *AuthHandler) UpdateMenuConfig(c *gin.Context)
- func (h *AuthHandler) UpdateProfile(c *gin.Context)
- func (h *AuthHandler) ValidateToken(c *gin.Context)
- type ConfigHandler
- type ContainerHandler
- func (h *ContainerHandler) ContainerTemplateTerminal(c *gin.Context)
- func (h *ContainerHandler) ContainerTemplateTerminalClose(c *gin.Context)
- func (h *ContainerHandler) ContainerTemplateTerminalExec(c *gin.Context)
- func (h *ContainerHandler) ContainerTemplateTerminalStatus(c *gin.Context)
- func (h *ContainerHandler) ContainerTerminalSessionCreate(c *gin.Context)
- func (h *ContainerHandler) CreateAppSession(c *gin.Context)
- func (h *ContainerHandler) CreateAppSessionByAnalysisNode(c *gin.Context)
- func (h *ContainerHandler) CreateContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) CreateContainerTemplateSpec(c *gin.Context)
- func (h *ContainerHandler) DeleteAppSession(c *gin.Context)
- func (h *ContainerHandler) DeleteContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) DeleteContainerTemplateSpec(c *gin.Context)
- func (h *ContainerHandler) DescribeContainerInstance(c *gin.Context)
- func (h *ContainerHandler) DownloadRuntimeProvision(c *gin.Context)
- func (h *ContainerHandler) ExportContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) GetAppSession(c *gin.Context)
- func (h *ContainerHandler) GetContainerRuntimeInfo(c *gin.Context)
- func (h *ContainerHandler) GetContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) GetContainerTemplateSpec(c *gin.Context)
- func (h *ContainerHandler) GetDefaultContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) GetQueueStatus(c *gin.Context)
- func (h *ContainerHandler) GetRuntimeProvisionStatus(c *gin.Context)
- func (h *ContainerHandler) ImportContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) InstallRuntimeProvision(c *gin.Context)
- func (h *ContainerHandler) ListAppSession(c *gin.Context)
- func (h *ContainerHandler) ListContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) ListContainerTemplateBySpec(c *gin.Context)
- func (h *ContainerHandler) ListContainerTemplateSpec(c *gin.Context)
- func (h *ContainerHandler) ListRuntimeMonitoringSnapshot(c *gin.Context)
- func (h *ContainerHandler) PageAppSession(c *gin.Context)
- func (h *ContainerHandler) PageContainerInstance(c *gin.Context)
- func (h *ContainerHandler) PageContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) PageContainerTemplateSpec(c *gin.Context)
- func (h *ContainerHandler) PageOutboxEvent(c *gin.Context)
- func (h *ContainerHandler) RecreateAppSessionContainer(c *gin.Context)
- func (h *ContainerHandler) SetDefaultContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) StartAppSession(c *gin.Context)
- func (h *ContainerHandler) StartRuntimeProvision(c *gin.Context)
- func (h *ContainerHandler) StopAppSession(c *gin.Context)
- func (h *ContainerHandler) UninstallRuntimeProvision(c *gin.Context)
- func (h *ContainerHandler) UpdateContainerTemplate(c *gin.Context)
- func (h *ContainerHandler) UpdateContainerTemplateSpec(c *gin.Context)
- type ContainerTerminalSessionCreateRequest
- type DataHandler
- func (h *DataHandler) AddFileToDataset(c *gin.Context)
- func (h *DataHandler) CreateAssay(c *gin.Context)
- func (h *DataHandler) CreateDataset(c *gin.Context)
- func (h *DataHandler) CreateDatasetAssay(c *gin.Context)
- func (h *DataHandler) CreateDatasetFile(c *gin.Context)
- func (h *DataHandler) CreateFile(c *gin.Context)
- func (h *DataHandler) CreateProjectDataset(c *gin.Context)
- func (h *DataHandler) DeleteAssay(c *gin.Context)
- func (h *DataHandler) DeleteDataset(c *gin.Context)
- func (h *DataHandler) DeleteDatasetAssay(c *gin.Context)
- func (h *DataHandler) DeleteDatasetFile(c *gin.Context)
- func (h *DataHandler) DeleteFile(c *gin.Context)
- func (h *DataHandler) DeleteProjectDataset(c *gin.Context)
- func (h *DataHandler) EnsureDatasetDir(c *gin.Context)
- func (h *DataHandler) GetAssay(c *gin.Context)
- func (h *DataHandler) GetDataset(c *gin.Context)
- func (h *DataHandler) GetDatasetAssay(c *gin.Context)
- func (h *DataHandler) GetDatasetAssayByAssayID(c *gin.Context)
- func (h *DataHandler) GetDatasetFile(c *gin.Context)
- func (h *DataHandler) GetFile(c *gin.Context)
- func (h *DataHandler) GetFileColumns(c *gin.Context)
- func (h *DataHandler) GetProjectDataset(c *gin.Context)
- func (h *DataHandler) ImportAssayTSV(c *gin.Context)
- func (h *DataHandler) ImportDatasetDirFiles(c *gin.Context)
- func (h *DataHandler) ListAssay(c *gin.Context)
- func (h *DataHandler) ListAssayByProjectID(c *gin.Context)
- func (h *DataHandler) ListDataset(c *gin.Context)
- func (h *DataHandler) ListDatasetAssay(c *gin.Context)
- func (h *DataHandler) ListDatasetByProjectID(c *gin.Context)
- func (h *DataHandler) ListDatasetDirFiles(c *gin.Context)
- func (h *DataHandler) ListDatasetFile(c *gin.Context)
- func (h *DataHandler) ListDatasetFiles(c *gin.Context)
- func (h *DataHandler) ListFile(c *gin.Context)
- func (h *DataHandler) ListFileByAnalysisNodeID(c *gin.Context)
- func (h *DataHandler) ListFileByAssayID(c *gin.Context)
- func (h *DataHandler) ListFileByProjectID(c *gin.Context)
- func (h *DataHandler) ListFileByProjectIDGroupByRole(c *gin.Context)
- func (h *DataHandler) ListProjectDataset(c *gin.Context)
- func (h *DataHandler) PageAssayByProjectID(c *gin.Context)
- func (h *DataHandler) PageDatasetByProjectID(c *gin.Context)
- func (h *DataHandler) PageFileByProjectID(c *gin.Context)
- func (h *DataHandler) PageFileByProjectIDViaAnalysisNode(c *gin.Context)
- func (h *DataHandler) UpdateAssay(c *gin.Context)
- func (h *DataHandler) UpdateDataset(c *gin.Context)
- func (h *DataHandler) UpdateDatasetAssay(c *gin.Context)
- func (h *DataHandler) UpdateFile(c *gin.Context)
- func (h *DataHandler) UpdateProjectDataset(c *gin.Context)
- func (h *DataHandler) UploadFileToDataset(c *gin.Context)
- type EditNodeParamsResponse
- type EditParamsV2Response
- type FileHandler
- func (h *FileHandler) CreateDir(c *gin.Context)
- func (h *FileHandler) CreateFile(c *gin.Context)
- func (h *FileHandler) Delete(c *gin.Context)
- func (h *FileHandler) Download(c *gin.Context)
- func (h *FileHandler) ListProjectDir(c *gin.Context)
- func (h *FileHandler) Move(c *gin.Context)
- func (h *FileHandler) Search(c *gin.Context)
- func (h *FileHandler) Upload(c *gin.Context)
- type GitHandler
- type ProjectHandler
- func (h *ProjectHandler) ActivateProject(c *gin.Context)
- func (h *ProjectHandler) AddLiterature(c *gin.Context)
- func (h *ProjectHandler) AddProjectReport(c *gin.Context)
- func (h *ProjectHandler) AddProjectReportItem(c *gin.Context)
- func (h *ProjectHandler) AddProjectToUser(c *gin.Context)
- func (h *ProjectHandler) AddUserProject(c *gin.Context)
- func (h *ProjectHandler) BindLiterature(c *gin.Context)
- func (h *ProjectHandler) CommitProjectReport(c *gin.Context)
- func (h *ProjectHandler) CreateProject(c *gin.Context)
- func (h *ProjectHandler) DeleteLiterature(c *gin.Context)
- func (h *ProjectHandler) DeleteProjectReport(c *gin.Context)
- func (h *ProjectHandler) DeleteProjectReportItem(c *gin.Context)
- func (h *ProjectHandler) DeleteUserProject(c *gin.Context)
- func (h *ProjectHandler) GetActiveProject(c *gin.Context)
- func (h *ProjectHandler) GetLiteratureDetail(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportContent(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportDetail(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportFile(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportFileHTML(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportGitDiff(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportHTML(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportItemContent(c *gin.Context)
- func (h *ProjectHandler) GetProjectReportItemDetail(c *gin.Context)
- func (h *ProjectHandler) ListLiterature(c *gin.Context)
- func (h *ProjectHandler) ListProject(c *gin.Context)
- func (h *ProjectHandler) ListProjectReport(c *gin.Context)
- func (h *ProjectHandler) ListProjectReportItem(c *gin.Context)
- func (h *ProjectHandler) PackageProjectReportItem(c *gin.Context)
- func (h *ProjectHandler) PageLiterature(c *gin.Context)
- func (h *ProjectHandler) PageLiteraturePool(c *gin.Context)
- func (h *ProjectHandler) PageProjectReport(c *gin.Context)
- func (h *ProjectHandler) ReorderProjectReportItem(c *gin.Context)
- func (h *ProjectHandler) RevertProjectReportFile(c *gin.Context)
- func (h *ProjectHandler) UnbindLiterature(c *gin.Context)
- func (h *ProjectHandler) UpdateLiterature(c *gin.Context)
- func (h *ProjectHandler) UpdateProjectReport(c *gin.Context)
- func (h *ProjectHandler) UpdateProjectReportFile(c *gin.Context)
- func (h *ProjectHandler) UpdateProjectReportItem(c *gin.Context)
- func (h *ProjectHandler) UpdateProjectSharing(c *gin.Context)
- type ProjectReportItemVar
- type ProxyHandler
- type PublishScriptRequest
- type PublishWorkflowRequest
- type RealtimeHandler
- type Resolved
- type RuntimeContext
- type RuntimeContextInfo
- type RuntimeContextResolver
- func (r *RuntimeContextResolver) Describe(ctx context.Context, userID int64, profileID int64, env map[string]any) (*RuntimeContextInfo, error)
- func (r *RuntimeContextResolver) Resolve(ctx context.Context, userID int64, env map[string]any) (*Resolved, error)
- func (r *RuntimeContextResolver) ResolveWithFacts(ctx context.Context, userID int64, env map[string]any) (*RuntimeContext, agenttypes.TaskFacts, error)
- type SettingHandler
- type SheetHandler
- type StoreHandler
- func (h *StoreHandler) CreateStore(c *gin.Context)
- func (h *StoreHandler) DeleteStore(c *gin.Context)
- func (h *StoreHandler) DownloadStore(c *gin.Context)
- func (h *StoreHandler) GetStore(c *gin.Context)
- func (h *StoreHandler) GetStoreByStoreID(c *gin.Context)
- func (h *StoreHandler) GetStoreImage(c *gin.Context)
- func (h *StoreHandler) ListStore(c *gin.Context)
- func (h *StoreHandler) PageStore(c *gin.Context)
- func (h *StoreHandler) PublishStoreRemote(c *gin.Context)
- func (h *StoreHandler) ReDownloadStore(c *gin.Context)
- func (h *StoreHandler) UpdateStore(c *gin.Context)
- type UploadHandler
- type VisualizationNodeFileResponse
- type VisualizationNodeTreeItem
- type VisualizationNodeTreeResponse
- type VisualizationResultResponse
- type WorkflowFormJSONResponse
- type WorkflowFormResponse
- type WorkflowHandler
- func (h *WorkflowHandler) DeleteScript(c *gin.Context)
- func (h *WorkflowHandler) DeleteWorkflow(c *gin.Context)
- func (h *WorkflowHandler) FindScript(c *gin.Context)
- func (h *WorkflowHandler) GenerateWorkflowJSON(c *gin.Context)
- func (h *WorkflowHandler) GetFromJSONByWorlflow(c *gin.Context)
- func (h *WorkflowHandler) GetScriptById(c *gin.Context)
- func (h *WorkflowHandler) GetScriptContent(c *gin.Context)
- func (h *WorkflowHandler) GetScriptForm(c *gin.Context)
- func (h *WorkflowHandler) GetScriptImage(c *gin.Context)
- func (h *WorkflowHandler) GetScriptReadme(c *gin.Context)
- func (h *WorkflowHandler) GetWorkflowById(c *gin.Context)
- func (h *WorkflowHandler) GetWorkflowForm(c *gin.Context)
- func (h *WorkflowHandler) GetWorkflowImage(c *gin.Context)
- func (h *WorkflowHandler) GetWorkflowReadme(c *gin.Context)
- func (h *WorkflowHandler) GetWorkflowVis(c *gin.Context)
- func (h *WorkflowHandler) InstallScript(c *gin.Context)
- func (h *WorkflowHandler) InstallWorkflow(c *gin.Context)
- func (h *WorkflowHandler) PageScript(c *gin.Context)
- func (h *WorkflowHandler) PageWorkflow(c *gin.Context)
- func (h *WorkflowHandler) PublishScript(c *gin.Context)
- func (h *WorkflowHandler) PublishWorkflow(c *gin.Context)
- func (h *WorkflowHandler) SaveScript(c *gin.Context)
- func (h *WorkflowHandler) SaveScriptContent(c *gin.Context)
- func (h *WorkflowHandler) SaveScriptFiles(c *gin.Context)
- func (h *WorkflowHandler) SaveScriptReadme(c *gin.Context)
- func (h *WorkflowHandler) SaveWorkflow(c *gin.Context)
- func (h *WorkflowHandler) SaveWorkflowDag(c *gin.Context)
- func (h *WorkflowHandler) SaveWorkflowFiles(c *gin.Context)
- func (h *WorkflowHandler) SaveWorkflowReadme(c *gin.Context)
- func (h *WorkflowHandler) ScriptToNode(c *gin.Context)
- func (h *WorkflowHandler) UploadScriptImage(c *gin.Context)
- func (h *WorkflowHandler) UploadWorkflowImage(c *gin.Context)
- type WorkflowJSONExportResponse
Constants ¶
const ( EnvTypeScript = "script" // 脚本工作区 EnvTypeAnalysis = "analysis" // 分析(analysis 级) EnvTypeAnalysisNode = "analysisNode" // 分析节点 EnvTypeProjectReport = "projectReport" // 项目报告 )
RuntimeEnvType 是与前端 llmEnv.type 约定的「业务上下文」枚举。
前端通过 setLLMEnv(id, type) 设置全局上下文,后端据此解析出:
- SystemPromptVars:渲染 Profile 系统提示词模板所需的变量(如工作目录、脚本路径);
- WorkingDir:Agent 执行时的工作目录(作为执行事实写入 Task.WorkingDir)。
这些枚举是前端与后端之间的契约,新增业务上下文时在此登记并同步前端 llm-env.ts。
Variables ¶
This section is empty.
Functions ¶
func GetDefaultIOSchame ¶
func GetDefaultIOSchame() string
func GetInitScript ¶
func NewNodeRequestParser ¶ added in v0.1.5
func NewNodeRequestParser(dataService interfaces.DataService, workflowService interfaces.WorkflowService) dagruntime.NodeRequestParser
NewNodeRequestParser 构造 dag 运行期需要的 request_param 解析器(注入 NodeDispatcher / NodeCompletionCoordinator 的 RuntimeEngine)。接口类型由 dag 包定义(consumer-side), 实现放在 handler 包,从而避免 dag -> handler 的循环依赖。
func RegisterOnlyOfficeRoutes ¶
func RegisterOnlyOfficeRoutes(r *gin.Engine, proxyHandler *ProxyHandler)
func RegisterProjectDocsRoute ¶
func RegisterProjectDocsRoute(r *gin.Engine, cfg *config.Config, projectService interfaces.ProjectService)
RegisterProjectDocsRoute registers the project docs entry route.
The only path parameter is a ProjectReport ID; the owning project id is resolved from the report and the docs are served from that report's doc source directory (see utils.GetProjectDocDir): - GET /docs/:reportid -> {projectDocBookDir}/index.html - GET /docs/:reportid/*filepath -> {projectDocBookDir}/*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, projectService interfaces.ProjectService) *AISummaryHandler
func (*AISummaryHandler) CreateAISummary ¶ added in v0.1.2
func (h *AISummaryHandler) CreateAISummary(c *gin.Context)
CreateAISummary godoc @Summary 创建 AI 摘要 @Description 根据 OwnerID/OwnerType 创建摘要记录(可指定 Agent Profile),并异步触发 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 根据摘要 ID 解析生成该摘要时交给 LLM 的系统提示词、工作目录与原始内容 @Tags AI摘要 @Produce json @Param id query integer true "摘要 ID" @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) PageAISummaryByActiveProject ¶ added in v0.1.5
func (h *AISummaryHandler) PageAISummaryByActiveProject(c *gin.Context)
PageAISummaryByActiveProject godoc @Summary 按当前用户激活项目分页查询 AI 摘要列表 @Description 解析当前登录用户的激活项目,分页返回该项目(project_id)下的 AI 摘要,不返回 content @Tags AI摘要 @Accept json @Produce json @Param request body handler.aiSummaryByProjectPageRequest 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 /ai-summary/list-by-project-page [post]
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]
func (*AISummaryHandler) UpdateAISummary ¶ added in v0.1.4
func (h *AISummaryHandler) UpdateAISummary(c *gin.Context)
UpdateAISummary godoc @Summary 更新 AI 摘要 @Description 按摘要 ID 更新标题、内容与 Agent Profile,字段不传则保持原值 @Tags AI摘要 @Accept json @Produce json @Param request body updateAISummaryRequest 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/update [post]
type AgentHandler ¶ added in v0.1.2
type AgentHandler struct {
// contains filtered or unexported fields
}
AgentHandler 处理 Agent 任务与权限相关接口。
职责边界(对应 design.md):
- HTTP 是 command(创建任务 / 批准 / 拒绝);
- WS 是 notification(StartEventBridge 全局订阅事件,按 AgentEvent.UserID 推送);
- AgentService / Repository 是真正的 state。
事件订阅不按任务维护:AgentEvent 自带 UserID,因此所有任务启动路径(含 ResumeTask / Recover 自动续跑)都无需再显式挂订阅。
func NewAgentHandler ¶ added in v0.1.2
func NewAgentHandler(svc *agentservice.AgentService, chat *agentservice.ChatService, hub *realtime.Hub, runtimeCtx *RuntimeContextResolver, skills *skill.Registry, skillStore *skill.Store) *AgentHandler
NewAgentHandler 创建 AgentHandler。
func (*AgentHandler) AnswerQuestion ¶ added in v0.1.5
func (h *AgentHandler) AnswerQuestion(c *gin.Context)
AnswerQuestion godoc @Summary 提交用户对提问的作答 @Tags Agent @Accept json @Produce json @Param request body handler.questionAnswerBody true "作答内容" @Success 200 {object} gin.H @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 409 {object} errors.AppError @Security Bearer @Router /agent/question/answer [post]
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 agenttypes.Request true "请求参数" @Success 200 {object} agenttypes.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 memoryIDBody 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) DeleteSkill ¶ added in v0.1.5
func (h *AgentHandler) DeleteSkill(c *gin.Context)
DeleteSkill godoc @Summary 删除 Agent 技能 @Description 删除 $BaseDir/.skills 下的技能目录并从内存注册表移除;仅允许删除用户技能目录内的技能 @Tags Agent @Accept json @Produce json @Param request body taskIDBody 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/skill/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 读取当前登录用户的 AgentConfig.EnvID/EnvType,返回人类可读的上下文名称与工作目录,供前端展示当前对话环境 @Tags Agent @Accept json @Produce json @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) 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} agenttypes.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} agenttypes.PermissionRequest @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/task/permissions [get]
func (*AgentHandler) GetPendingQuestions ¶ added in v0.1.5
func (h *AgentHandler) GetPendingQuestions(c *gin.Context)
GetPendingQuestions godoc @Summary 获取任务待作答提问 @Tags Agent @Produce json @Param task_id query string true "任务 ID" @Success 200 {array} agenttypes.QuestionRequest @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/task/questions [get]
func (*AgentHandler) GetProfile ¶ added in v0.1.5
func (h *AgentHandler) GetProfile(c *gin.Context)
GetProfile godoc @Summary 查看单个 Agent Profile @Description 按 ID 返回单个 Profile(全局可见) @Tags Agent @Produce json @Param id query string true "Profile ID" @Success 200 {object} agenttypes.Profile @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/profile/get [get]
func (*AgentHandler) GetSession ¶ added in v0.2.0
func (h *AgentHandler) GetSession(c *gin.Context)
GetSession godoc @Summary 获取会话(含一页历史消息) @Description 默认只返回最新一页消息;向上滚动时把响应的 next_cursor 作为 before_seq 继续加载更早的消息 @Tags Agent @Produce json @Param id query string true "会话 ID" @Param before_seq query int false "向上翻页游标(上一页的 next_cursor),0 表示最新一页" @Param limit query int false "本页最大条数(默认 30,最大 200)" @Success 200 {object} agentservice.SessionDetail @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/session/get [get]
func (*AgentHandler) GetSkill ¶ added in v0.1.5
func (h *AgentHandler) GetSkill(c *gin.Context)
GetSkill godoc @Summary 查看单个 Agent 技能 @Description 按名称返回单个技能(含指令正文),供前端编辑回填 @Tags Agent @Produce json @Param id query string true "技能名" @Success 200 {object} skill.Skill @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/skill/get [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} agenttypes.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) 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} agenttypes.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) GetTaskTimeline ¶ added in v0.2.0
func (h *AgentHandler) GetTaskTimeline(c *gin.Context)
GetTaskTimeline godoc @Summary 获取任务的执行时间线 @Description 返回该任务已落库的时间线消息(reasoning / assistant / tool_call / tool_result / error), @Description 用于前端刷新 / 切换会话后回填「事实流」:增量事件(text / reasoning_delta)只广播 @Description 不落库,完整块事件由 TimelineRecorder 即时写入 agent_messages。 @Tags Agent @Produce json @Param task_id query string true "任务 ID" @Success 200 {array} agenttypes.Message @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/task/timeline [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} agenttypes.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 返回当前可用的全部技能(内置 + 用户自定义),包含名称、描述与 SKILL.md 路径 @Tags Agent @Produce json @Success 200 {array} skill.Skill @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/skill/list [get]
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) PageQuestions ¶ added in v0.1.5
func (h *AgentHandler) PageQuestions(c *gin.Context)
PageQuestions godoc @Summary 分页查询提问请求 @Tags Agent @Accept json @Produce json @Param request body handler.agentQuestionPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/question/page [post]
func (*AgentHandler) PageSessions ¶ added in v0.2.0
func (h *AgentHandler) PageSessions(c *gin.Context)
PageSessions godoc @Summary 分页查询当前用户的会话 @Tags Agent @Accept json @Produce json @Param request body handler.sessionPageRequest true "分页请求参数" @Success 200 {object} map[string]interface{} @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /agent/session/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) ResolveSkill ¶ added in v0.2.0
func (h *AgentHandler) ResolveSkill(c *gin.Context)
ResolveSkill godoc @Summary 按名称解析 Agent 技能(含模板渲染) @Description 与 get_skill 工具同一实现:按名称解析技能,并用当前用户业务上下文(llmEnv)解析出的变量渲染指令正文 @Tags Agent @Produce json @Param id query string true "技能名" @Success 200 {object} skill.GetSkillOutput @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /agent/skill/resolve [get]
func (*AgentHandler) ResumeTask ¶ added in v0.2.0
func (h *AgentHandler) ResumeTask(c *gin.Context)
ResumeTask godoc @Summary 从持久化检查点继续执行 Agent 任务 @Description 用于后端重启 / 进程崩溃导致执行循环退出、但任务仍有可恢复检查点的场景。 @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 409 {object} errors.AppError @Security Bearer @Router /agent/task/resume [post]
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} agenttypes.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} agenttypes.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 为空时新建,否则更新;内置 Profile 可编辑(不可删除) @Tags Agent @Accept json @Produce json @Param request body handler.profileSaveRequest true "Profile 内容" @Success 200 {object} agenttypes.Profile @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /agent/profile/save [post]
func (*AgentHandler) SaveSkill ¶ added in v0.1.5
func (h *AgentHandler) SaveSkill(c *gin.Context)
SaveSkill godoc @Summary 创建或更新 Agent 技能 @Description 把技能写回 $BaseDir/.skills/<name>/SKILL.md 并热更新内存注册表,程序运行中即时生效 @Tags Agent @Accept json @Produce json @Param request body handler.skillSaveRequest true "技能内容" @Success 200 {object} skill.Skill @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /agent/skill/save [post]
func (*AgentHandler) StartEventBridge ¶ added in v0.2.0
func (h *AgentHandler) StartEventBridge()
StartEventBridge 注册全局 Agent 事件订阅,把事件按 AgentEvent.UserID 推送到对应的 WS 连接。
为什么是全局订阅而不是逐任务订阅:
- 事件已经自带归属用户(服务层从 TaskFacts 填充),路由不需要任务表;
- 任务可能在 HTTP 请求之外的路径启动(ResumeTask / Recover 自动续跑 / 权限决策后续跑),逐任务订阅必须覆盖每个启动点,容易遗漏;
- 订阅没有 per-task 状态,不存在“终态未到导致订阅泄漏”的问题。
后台任务(无登录用户,UserID == 0)不推送。历史时间线仍以 agent_messages 为准。
func (*AgentHandler) StopEventBridge ¶ added in v0.2.0
func (h *AgentHandler) StopEventBridge()
StopEventBridge 取消全局事件订阅(供容器关闭 / 测试清理使用)。
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, containerRepo interfaces.ContainerRepository, containerManager *manager.ContainerManager, analysisRepo interfaces.AnalysisRepository, schedulers *scheduler.Registry, nodeOrchestrator interfaces.NodeOrchestrator, preparer prepare.NodeRuntimePreparer, 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) AnalysisNodeTerminal ¶ added in v0.2.0
func (h *AnalysisHandler) AnalysisNodeTerminal(c *gin.Context)
AnalysisNodeTerminal 通过 WebSocket 把 xterm.js 连接到运行中的节点容器。
等价于 `kubectl exec -it <pod> -- /bin/bash` / `docker exec -it <container> /bin/bash`: 只在容器 running 时可连接;节点结束后连接会被拒绝。节点与容器的关系沿用 DAG 节点约定 (OwnerType=dag_node, OwnerID=node.ID),因此命令型节点与脚本节点都适用。
func (*AnalysisHandler) CreateCommandAnalysisNode ¶ added in v0.2.0
func (h *AnalysisHandler) CreateCommandAnalysisNode(c *gin.Context)
CreateCommandAnalysisNode 手动创建一个命令型 AnalysisNode(无脚本)。
它等价于 Agent 工具 create_agent_analysis 的「建节点 + 写 run.sh」,只是由用户在 分析节点列表里主动触发;节点创建后与普通分析节点共用运行 / 停止 / 日志链路。
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) GetAnalysisNodeCommand ¶ added in v0.2.0
func (h *AnalysisHandler) GetAnalysisNodeCommand(c *gin.Context)
GetAnalysisNodeCommand godoc @Summary 读取分析节点 run.sh @Description 返回 AnalysisNode.command_path 的绝对路径与内容;文件尚未生成时 exists=false @Tags 分析 @Produce json @Param analysisNodeId path string true "分析节点 ID" @Success 200 {object} handler.AnalysisNodeCommandResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/{analysisNodeId}/command [get]
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) PublishProjectReportItemToDoc ¶ added in v0.1.5
func (h *AnalysisHandler) PublishProjectReportItemToDoc(c *gin.Context)
PublishProjectReportItemToDoc 是单条目发布入口(POST /project-report-item/:itemId/publish-to-doc)。 它按 ProjectReportItem 的 OwnerType 解析出 OwnerID,并将对应内容发布到该条目所属 ProjectReport 的文档目录(见 utils.GetProjectDocDir)。
支持的 OwnerType:
- analysis → 发布 Analysis 及其节点输出
- analysis_node → 发布单个 AnalysisNode 输出
- ai_summary → 发布 AI 摘要(同时拷贝其所属对象的输出目录以引用图片)
func (*AnalysisHandler) PublishProjectReportToDoc ¶ added in v0.1.2
func (h *AnalysisHandler) PublishProjectReportToDoc(c *gin.Context)
PublishProjectReportToDoc 遍历报告下所有 ProjectReportItem 并逐个发布到报告文档目录 (POST /project-report/:reportId/publish-to-doc)。
func (*AnalysisHandler) RunAnalysisNode ¶
func (h *AnalysisHandler) RunAnalysisNode(c *gin.Context)
func (*AnalysisHandler) RunAnalysisNodeByScriptID ¶
func (h *AnalysisHandler) RunAnalysisNodeByScriptID(c *gin.Context)
RunAnalysisNodeByScriptID 批量运行 script 下所有 creation_source=script 的 analysis node
func (*AnalysisHandler) RunAnalysisNodeWithID ¶
func (h *AnalysisHandler) RunAnalysisNodeWithID(ctx context.Context, analsyisNodeId int64) error
func (*AnalysisHandler) RuntimeSnapshot ¶ added in v0.1.4
func (h *AnalysisHandler) RuntimeSnapshot(c *gin.Context)
RuntimeSnapshot godoc @Summary 分析运行时快照 @Description 兼容 Python POST /analysis-runtime/snapshot,返回节点状态分布、完成度、运行信息以及分析状态 @Tags 分析 @Accept json @Produce json @Param request body handler.runtimeSnapshotRequest true "查询参数" @Success 200 {object} handler.runtimeSnapshotResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis-runtime/snapshot [post]
func (*AnalysisHandler) SaveAnalysisController ¶
func (h *AnalysisHandler) SaveAnalysisController(c *gin.Context)
SaveAnalysisController is the single submit/save entry for every DAG scheduler.
The scheduler is chosen per request through the orchestration registry (dag/scheduler.Registry) and persisted in analysis.scheduler_mode, so this one endpoint replaces the former controller / controllerV2 / controllerV3 trio. The resolved scheduler also decides whether the compiled graph is persisted at save time (static graph) or materialized at runtime.
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) UpdateAnalysisNodeCommand ¶ added in v0.2.0
func (h *AnalysisHandler) UpdateAnalysisNodeCommand(c *gin.Context)
UpdateAnalysisNodeCommand godoc @Summary 保存分析节点 run.sh @Description 把内容写入 AnalysisNode.command_path(run.sh);命令节点直接以该文件作为运行脚本,因此无需回写数据库 @Tags 分析 @Accept json @Produce json @Param analysisNodeId path string true "分析节点 ID" @Param request body handler.updateAnalysisNodeCommandRequest true "run.sh 内容" @Success 200 {object} handler.AnalysisNodeCommandResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /analysis/{analysisNodeId}/command [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 AnalysisNodeCommandResponse ¶ added in v0.2.0
type AnalysisNodeCommandResponse struct {
AnalysisNodeID string `json:"analysis_node_id"`
CommandPath string `json:"command_path"`
Content string `json:"content"`
// Exists 为 false 表示 run.sh 尚未生成(节点还没被 prepare 过)。
Exists bool `json:"exists"`
}
AnalysisNodeCommandResponse 是节点 run.sh(command_path)的读写响应。
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, agentService *agentservice.AgentService) *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) InitUser ¶ added in v0.2.1
func (h *AuthHandler) InitUser(ctx context.Context, user *types.User)
InitUser 初始化用户的首个可用环境:创建并激活默认项目。 注册与桌面端内置用户共用该逻辑;失败仅记录日志,不回滚已创建的用户。
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) UpdateAgentConfig ¶ added in v0.1.4
func (h *AuthHandler) UpdateAgentConfig(c *gin.Context)
UpdateAgentConfig godoc @Summary 更新当前用户的 Agent 配置 @Description 修改当前登录用户的 Agent 配置(Profile + 权限策略 + 当前业务上下文) @Tags 认证 @Accept json @Produce json @Param request body object{profile_id=string,permissions=object,env_id=string,env_type=string} true "Agent 配置" @Success 200 {object} map[string]interface{} "更新成功" @Failure 400 {object} errors.AppError "请求参数错误" @Security Bearer @Router /auth/agent-config [post]
func (*AuthHandler) UpdateAgentEnv ¶ added in v0.2.0
func (h *AuthHandler) UpdateAgentEnv(c *gin.Context)
UpdateAgentEnv godoc @Summary 更新当前用户的业务上下文(llmEnv) @Description 只修改当前登录用户的 AgentConfig.EnvID / EnvType,用于业务页面进入时绑定当前上下文;不触碰 Profile 与权限 @Tags 认证 @Accept json @Produce json @Param request body object{env_id=string,env_type=string} true "业务上下文" @Success 200 {object} map[string]interface{} "更新成功" @Failure 400 {object} errors.AppError "请求参数错误" @Security Bearer @Router /auth/agent-env [post]
func (*AuthHandler) UpdateBottomPanel ¶ added in v0.2.0
func (h *AuthHandler) UpdateBottomPanel(c *gin.Context)
UpdateBottomPanel godoc @Summary 更新当前用户在当前项目下的底部面板配置 @Description 保存底部面板的标签列表 / 激活标签 / 展开态 / 高度,与主区域标签页一起落在当前激活项目的 user_project.menu_config @Tags 认证 @Accept json @Produce json @Param request body object{open=bool,active=string,height=int,tabs=[]types.UserBottomTab} true "底部面板状态" @Success 200 {object} map[string]interface{} "更新成功" @Failure 400 {object} errors.AppError "请求参数错误" @Failure 404 {object} errors.AppError "没有激活项目" @Security Bearer @Router /auth/bottom-panel [post]
func (*AuthHandler) UpdateMenuConfig ¶ added in v0.2.0
func (h *AuthHandler) UpdateMenuConfig(c *gin.Context)
UpdateMenuConfig godoc @Summary 更新当前用户在当前项目下的主标签页配置 @Description 保存主区域标签页(URL + 显示名)到当前激活项目的 user_project.menu_config,前端刷新时从 /auth/me 的 user.menu_config 回填 @Tags 认证 @Accept json @Produce json @Param request body object{tabs=[]types.UserMenuTab} true "标签页列表(数组顺序即标签栏顺序)" @Success 200 {object} map[string]interface{} "更新成功" @Failure 400 {object} errors.AppError "请求参数错误" @Failure 404 {object} errors.AppError "没有激活项目" @Security Bearer @Router /auth/menu-config [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 ConfigHandler ¶ added in v0.1.4
type ConfigHandler struct {
// contains filtered or unexported fields
}
ConfigHandler 提供 config.yml 的可视化读写能力。
接口是「配置段无关」的:GET 返回所有已注册配置段的当前生效值用于表单回填, POST 按 section 名写入。新增配置段只需在 config 包注册,无需新增接口。
func NewConfigHandler ¶ added in v0.1.4
func NewConfigHandler(cfg *config.Config) *ConfigHandler
func (*ConfigHandler) GetConfigFile ¶ added in v0.1.4
func (h *ConfigHandler) GetConfigFile(c *gin.Context)
GetConfigFile godoc @Summary 获取 config.yml 配置 @Description 返回 config.yml 的路径、文件是否存在,以及所有可编辑配置段的当前生效值(用于表单回填) @Tags 系统配置 @Produce json @Success 200 {object} configFileResponse @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /config/file/get [get]
func (*ConfigHandler) GetModelProviderOptions ¶ added in v0.2.0
func (h *ConfigHandler) GetModelProviderOptions(c *gin.Context)
GetModelProviderOptions godoc @Summary 获取模型厂商与模型选项 @Description 返回内置模型厂商目录(含默认 base_url 与常见模型)、预置模型参数,以及当前生效的 agent.providers @Tags 系统配置 @Produce json @Success 200 {object} modelProviderOptionsResponse @Failure 401 {object} errors.AppError @Security Bearer @Router /config/model/providers [get]
func (*ConfigHandler) UpdateConfigSection ¶ added in v0.1.4
func (h *ConfigHandler) UpdateConfigSection(c *gin.Context)
UpdateConfigSection godoc @Summary 更新一个配置段 @Description 按 section 把配置写入 config.yml(文件不存在则创建),其余配置段保持不变 @Tags 系统配置 @Accept json @Produce json @Param request body updateConfigSectionRequest true "配置段内容" @Success 200 {object} updateConfigSectionResponse @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /config/file/section/update [post]
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, terminalRegistry *manager.TerminalSessionRegistry, provisionManager *provision.Manager, cfg *config.Config) *ContainerHandler
func (*ContainerHandler) ContainerTemplateTerminal ¶ added in v0.2.0
func (h *ContainerHandler) ContainerTemplateTerminal(c *gin.Context)
ContainerTemplateTerminal 通过 WebSocket 连接「已有的终端会话」。
只按会话 ID attach,不再支持按 templateId 建立连接(容器由 create 接口创建)。
协议:
- 浏览器 → 后端:二进制/文本都是按键输入;文本 {"type":"resize",...} 是尺寸控制帧;
- 后端 → 浏览器:二进制为 PTY 输出;文本为 JSON 控制事件(session / exec / exit) 或纯文本提示。
@Summary 容器终端会话 WebSocket @Description 用终端会话 ID 接入交互式终端;会话不在内存时会按数据库记录自动认领原容器并重建 shell。 @Tags 容器管理 @Param id path int true "终端会话 ID" @Param since query int false "从指定输出序号重放(缺省回放全部缓存)" @Param rows query int false "PTY 行数(浏览器 xterm 尺寸,可选)" @Param cols query int false "PTY 列数(浏览器 xterm 尺寸,可选)" @Success 101 @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/terminal/session/{id}/terminal [get]
func (*ContainerHandler) ContainerTemplateTerminalClose ¶ added in v0.2.0
func (h *ContainerHandler) ContainerTemplateTerminalClose(c *gin.Context)
ContainerTemplateTerminalClose 主动结束会话并删除容器。
@Summary 关闭容器终端会话 @Description 结束会话(关闭 shell 并删除容器)。 @Tags 容器管理 @Param id path int true "终端会话 ID" @Success 200 {object} map[string]bool @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /container/terminal/session/{id} [delete]
func (*ContainerHandler) ContainerTemplateTerminalExec ¶ added in v0.2.0
func (h *ContainerHandler) ContainerTemplateTerminalExec(c *gin.Context)
ContainerTemplateTerminalExec 向「指定的终端会话」写入一条命令。
语义:
- 只能写入已存在的会话(容器由 create 接口创建,这里不再自动创建);
- wait_seconds=0:只投递命令,立即返回 accepted=true / running=true, 命令输出通过该会话的 WebSocket 实时回传;
- wait_seconds>0:等待命令结束(或超时),返回退出码与输出尾部。
同一会话的命令串行执行;Agent 的 terminal_exec 工具复用同一底层实现。
@Summary 容器终端会话执行命令 @Description 向指定终端会话写入命令;wait_seconds=0 时为异步投递。 @Tags 容器管理 @Accept json @Produce json @Param id path int true "终端会话 ID" @Param request body handler.containerTerminalExecRequest true "命令" @Success 200 {object} handler.containerTerminalExecResponse @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 /container/terminal/session/{id}/terminal/exec [post]
func (*ContainerHandler) ContainerTemplateTerminalStatus ¶ added in v0.2.0
func (h *ContainerHandler) ContainerTemplateTerminalStatus(c *gin.Context)
ContainerTemplateTerminalStatus 返回会话状态(用于前端判断是否需要重放 / 重连)。
@Summary 容器终端会话状态 @Description 返回会话是否存在、存活、订阅者数量与当前输出序号。 @Tags 容器管理 @Param id path int true "终端会话 ID" @Success 200 {object} manager.TerminalSessionStatus @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Security Bearer @Router /container/terminal/session/{id}/status [get]
func (*ContainerHandler) ContainerTerminalSessionCreate ¶ added in v0.2.0
func (h *ContainerHandler) ContainerTerminalSessionCreate(c *gin.Context)
ContainerTerminalSessionCreate 按容器模板新建一条终端会话并立即启动容器。
@Summary 新建容器终端会话 @Description 按容器模板创建终端会话(创建时即启动容器与 shell),返回会话 ID。 @Tags 容器管理 @Accept json @Produce json @Param request body handler.ContainerTerminalSessionCreateRequest true "创建参数" @Success 200 {object} manager.TerminalSessionStatus @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 /container/terminal/session/create [post]
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) CreateContainerTemplate ¶
func (h *ContainerHandler) CreateContainerTemplate(c *gin.Context)
CreateContainerTemplate godoc @Summary 创建容器模板 @Description 创建对外容器模板(ContainerTemplate = 共享运行配置 ContainerTemplateSpec × 镜像绑定 ContainerTemplateDefinition)。 @Description spec_id 为空:用请求体里的运行配置字段新建配置,再建第一条绑定; @Description spec_id 非空:复用该配置,只在它下面新增一个镜像绑定(同一套配置挂多个镜像)。 @Description 返回组装后的读模型,含 spec_id / image_name / pull_policy。 @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) CreateContainerTemplateSpec ¶ added in v0.1.4
func (h *ContainerHandler) CreateContainerTemplateSpec(c *gin.Context)
CreateContainerTemplateSpec godoc @Summary 创建容器运行配置 @Description 新增一条共享运行配置(ContainerTemplateSpec,表 go_container_template_spec)。 @Tags 容器管理 @Accept json @Produce json @Param request body types.ContainerTemplateSpec true "请求参数" @Success 200 {object} types.ContainerTemplateSpec @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template-spec/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) DeleteContainerTemplate ¶
func (h *ContainerHandler) DeleteContainerTemplate(c *gin.Context)
DeleteContainerTemplate godoc @Summary 删除容器模板 @Description 按绑定行 ID(ContainerTemplateDefinition.ID)删除该镜像绑定; @Description 当这张绑定所属的共享运行配置已无任何其他镜像绑定时,一并清理该配置。 @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) DeleteContainerTemplateSpec ¶ added in v0.1.4
func (h *ContainerHandler) DeleteContainerTemplateSpec(c *gin.Context)
DeleteContainerTemplateSpec godoc @Summary 删除容器运行配置 @Description 按主键删除 ContainerTemplateSpec;仍被绑定行引用时返回 409。 @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 409 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template-spec/delete [post]
func (*ContainerHandler) DescribeContainerInstance ¶ added in v0.1.4
func (h *ContainerHandler) DescribeContainerInstance(c *gin.Context)
DescribeContainerInstance godoc @Summary 容器实例详情 @Description 按 ContainerInstance ID 从运行时获取 inspect/describe 详情(兼容 docker 与 k8s) @Tags 容器管理 @Produce json @Param id query int64 true "容器实例 ID" @Success 200 {object} containerruntime.RuntimeDescription @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/instance/describe [get]
func (*ContainerHandler) DownloadRuntimeProvision ¶ added in v0.2.4
func (h *ContainerHandler) DownloadRuntimeProvision(c *gin.Context)
DownloadRuntimeProvision godoc @Summary 下载容器运行时包 @Description 异步下载 rootfs 包(支持断点续传),进度通过 status 接口轮询。 @Tags 容器管理 @Produce json @Success 202 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /container/runtime/provision/download [post]
func (*ContainerHandler) ExportContainerTemplate ¶ added in v0.1.4
func (h *ContainerHandler) ExportContainerTemplate(c *gin.Context)
ExportContainerTemplate godoc @Summary 导出容器模板 @Description 导出单条容器模板为统一的平铺格式(与 script.json / workflow.json 完全相同): @Description container_template_specs / container_template_definitions 两个列表, @Description 两者通过主键互相引用(definition.spec_id),且都不含时间字段。 @Tags 容器管理 @Accept json @Produce json @Param request body idBody true "请求参数" @Success 200 {object} types.ContainerTemplateBundle @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/export [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) GetContainerRuntimeInfo ¶ added in v0.2.4
func (h *ContainerHandler) GetContainerRuntimeInfo(c *gin.Context)
GetContainerRuntimeInfo godoc @Summary 容器运行时环境信息 @Description 返回默认运行时信息:运行时名称由容器实际执行时同一份逻辑解析 @Description (manager.ContainerLifecycle.ResolveRuntimeName:container.default_runtime → @Description container.runtimes[0] → 唯一已注册运行时 → docker),并探测其依赖 @Description (docker daemon Ping、k8s apiserver ServerVersion)。 @Description 同时返回宿主操作系统 / 架构、实际连接地址(已脱敏)与对端版本, @Description 供前端在页面上展示运行环境。 @Tags 容器管理 @Produce json @Success 200 {object} containerruntime.RuntimeHealth @Failure 401 {object} errors.AppError @Security Bearer @Router /container/runtime/info [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) GetContainerTemplateSpec ¶ added in v0.1.4
func (h *ContainerHandler) GetContainerTemplateSpec(c *gin.Context)
GetContainerTemplateSpec godoc @Summary 获取容器运行配置 @Description 按 ID 查询 ContainerTemplateSpec 详情 @Tags 容器管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.ContainerTemplateSpec @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-spec/get [get]
func (*ContainerHandler) GetDefaultContainerTemplate ¶ added in v0.2.0
func (h *ContainerHandler) GetDefaultContainerTemplate(c *gin.Context)
GetDefaultContainerTemplate godoc @Summary 获取默认容器模板 @Description 返回 is_default=true 的容器模板(ContainerTemplate 读模型);没有默认模板时返回 data=null。 @Description create_script 未显式指定 container_template_id 时会使用这一条。 @Tags 容器管理 @Produce json @Success 200 {object} map[string]interface{} @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template/default [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) GetRuntimeProvisionStatus ¶ added in v0.2.4
func (h *ContainerHandler) GetRuntimeProvisionStatus(c *gin.Context)
GetRuntimeProvisionStatus godoc @Summary 容器运行时安装状态 @Description 返回自管容器运行时的安装/运行状态(Windows 上是 WSL 发行版,Linux 上是本机 dockerd)。 @Description 未启用预置时 state 恒为 not_installed 并给出 detail 说明。 @Tags 容器管理 @Produce json @Success 200 {object} provision.RuntimeStatus @Failure 401 {object} errors.AppError @Security Bearer @Router /container/runtime/provision/status [get]
func (*ContainerHandler) ImportContainerTemplate ¶ added in v0.1.4
func (h *ContainerHandler) ImportContainerTemplate(c *gin.Context)
ImportContainerTemplate godoc @Summary 导入容器模板 @Description 导入统一平铺格式(与 /container/template/export、script.json / workflow.json 同构): @Description container_template_specs / container_template_definitions。 @Description 两张表都按主键 upsert:id 已存在则更新,不存在则按同一 id 新增;安装顺序固定为 @Description 「运行配置 → 绑定行」。definition.is_default 为 true 时同时设为唯一默认模板。 @Tags 容器管理 @Accept json @Produce json @Param request body types.ContainerTemplateBundle true "请求参数" @Success 200 {object} types.ContainerTemplateBundle @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/import [post]
func (*ContainerHandler) InstallRuntimeProvision ¶ added in v0.2.4
func (h *ContainerHandler) InstallRuntimeProvision(c *gin.Context)
InstallRuntimeProvision godoc @Summary 安装容器运行时 @Description 异步导入发行版并启动 dockerd(要求已下载),进度通过 status 接口轮询。 @Tags 容器管理 @Produce json @Success 202 {object} map[string]string @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /container/runtime/provision/install [post]
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) 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) ListContainerTemplateBySpec ¶ added in v0.1.4
func (h *ContainerHandler) ListContainerTemplateBySpec(c *gin.Context)
ListContainerTemplateBySpec godoc @Summary 按共享配置列出容器模板// @Description 列出同一套 ContainerTemplateSpec 下绑定不同镜像的所有对外模板(一个配置 × 多个镜像) @Tags 容器管理 @Accept json @Produce json @Param request body containerTemplateListBySpecRequest true "请求参数" @Success 200 {array} 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/list-by-spec [post]
func (*ContainerHandler) ListContainerTemplateSpec ¶ added in v0.1.4
func (h *ContainerHandler) ListContainerTemplateSpec(c *gin.Context)
ListContainerTemplateSpec godoc @Summary 容器运行配置列表 @Description 查询全部 ContainerTemplateSpec @Tags 容器管理 @Produce json @Success 200 {array} types.ContainerTemplateSpec @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /container/template-spec/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) 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) PageContainerTemplateSpec ¶ added in v0.1.4
func (h *ContainerHandler) PageContainerTemplateSpec(c *gin.Context)
PageContainerTemplateSpec godoc @Summary 分页查询容器运行配置 @Description 分页查询 ContainerTemplateSpec 列表 @Tags 容器管理 @Accept json @Produce json @Param request body containerTemplateSpecPageRequest 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-spec/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) SetDefaultContainerTemplate ¶ added in v0.2.0
func (h *ContainerHandler) SetDefaultContainerTemplate(c *gin.Context)
SetDefaultContainerTemplate godoc @Summary 设置默认容器模板 @Description 按绑定行 ID(ContainerTemplateDefinition.ID)把该模板设为唯一默认模板,并清空其它模板的默认标记。 @Tags 容器管理 @Accept json @Produce json @Param request body idBody 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/set-default [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) StartRuntimeProvision ¶ added in v0.2.4
func (h *ContainerHandler) StartRuntimeProvision(c *gin.Context)
StartRuntimeProvision godoc @Summary 启动容器运行时 @Description 手动触发一次启动自检(与进程启动时的行为一致):已安装则确保 daemon 运行并返回 endpoint, @Description 未安装返回 409,由前端引导至安装向导。 @Tags 容器管理 @Produce json @Success 200 {object} map[string]string @Failure 401 {object} errors.AppError @Failure 409 {object} errors.AppError @Security Bearer @Router /container/runtime/provision/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) UninstallRuntimeProvision ¶ added in v0.2.4
func (h *ContainerHandler) UninstallRuntimeProvision(c *gin.Context)
UninstallRuntimeProvision godoc @Summary 卸载容器运行时 @Description 注销发行版并删除数据目录(同步执行)。必须显式传 confirm=true。 @Tags 容器管理 @Accept json @Produce json @Success 200 {object} map[string]bool @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Security Bearer @Router /container/runtime/provision/uninstall [post]
func (*ContainerHandler) UpdateContainerTemplate ¶
func (h *ContainerHandler) UpdateContainerTemplate(c *gin.Context)
UpdateContainerTemplate godoc @Summary 更新容器模板 @Description 按绑定行 ID(ContainerTemplateDefinition.ID)更新:请求体里的运行配置字段写入绑行指向的 ContainerTemplateSpec, @Description image_name / pull_policy 与包目录字段写入绑定行本体。返回组装后的读模型。 @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/update [post]
func (*ContainerHandler) UpdateContainerTemplateSpec ¶ added in v0.1.4
func (h *ContainerHandler) UpdateContainerTemplateSpec(c *gin.Context)
UpdateContainerTemplateSpec godoc @Summary 更新容器运行配置 @Description 按主键更新 ContainerTemplateSpec(不影响绑定行)。 @Tags 容器管理 @Accept json @Produce json @Param request body types.ContainerTemplateSpec true "请求参数" @Success 200 {object} types.ContainerTemplateSpec @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-spec/update [post]
type ContainerTerminalSessionCreateRequest ¶ added in v0.2.0
type ContainerTerminalSessionCreateRequest struct {
// ContainerTemplateID 是必填的容器模板 ID(go_container_template_definition 主键)。
ContainerTemplateID int64 `json:"container_template_id,string" binding:"required"`
// Rows / Cols 是前端 xterm 的尺寸:新建会话直接用它建 PTY,
// 保证历史输出的换行与前端渲染一致。为 0 时使用默认 24x80。
Rows uint16 `json:"rows"`
Cols uint16 `json:"cols"`
}
ContainerTerminalSessionCreateRequest 是「新建终端会话」的入参。
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) CreateAssay ¶ added in v0.1.5
func (h *DataHandler) CreateAssay(c *gin.Context)
CreateAssay godoc @Summary 创建 Assay @Description 创建 Assay 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.Assay true "请求参数" @Success 200 {object} types.Assay @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/assay/create [post]
func (*DataHandler) CreateDataset ¶
func (h *DataHandler) CreateDataset(c *gin.Context)
CreateDataset godoc @Summary 创建数据集 @Description 在当前用户激活的项目下创建 Dataset 记录,并自动建立 ProjectDataset 关联;主键由服务端生成 @Tags 数据管理 @Accept json @Produce json @Param request body types.CreateDatasetRequest 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) CreateDatasetAssay ¶ added in v0.1.5
func (h *DataHandler) CreateDatasetAssay(c *gin.Context)
CreateDatasetAssay godoc @Summary 创建数据集-Assay 映射 @Description 创建 DatasetAssay 记录(数据集直接与 Assay 关联) @Tags 数据管理 @Accept json @Produce json @Param request body types.DatasetAssay true "请求参数" @Success 200 {object} types.DatasetAssay @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-assay/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) 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) DeleteAssay ¶ added in v0.1.5
func (h *DataHandler) DeleteAssay(c *gin.Context)
DeleteAssay godoc @Summary 删除 Assay @Description 按 ID 删除 Assay,并手动清理关联映射关系 @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/assay/delete [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) DeleteDatasetAssay ¶ added in v0.1.5
func (h *DataHandler) DeleteDatasetAssay(c *gin.Context)
DeleteDatasetAssay godoc @Summary 删除数据集-Assay 映射 @Description 按 ID 删除 DatasetAssay 记录 @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-assay/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) 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) EnsureDatasetDir ¶ added in v0.1.4
func (h *DataHandler) EnsureDatasetDir(c *gin.Context)
EnsureDatasetDir godoc @Summary 创建数据集目录 @Description 校验 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/ensure-dir [post]
func (*DataHandler) GetAssay ¶ added in v0.1.5
func (h *DataHandler) GetAssay(c *gin.Context)
GetAssay godoc @Summary 获取 Assay @Description 按 ID 查询 Assay 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.Assay @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/assay/get [get]
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) GetDatasetAssay ¶ added in v0.1.5
func (h *DataHandler) GetDatasetAssay(c *gin.Context)
GetDatasetAssay godoc @Summary 获取数据集-Assay 映射 @Description 按 ID 查询 DatasetAssay 详情 @Tags 数据管理 @Produce json @Param id query integer true "主键 ID" @Success 200 {object} types.DatasetAssay @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-assay/get [get]
func (*DataHandler) GetDatasetAssayByAssayID ¶ added in v0.1.5
func (h *DataHandler) GetDatasetAssayByAssayID(c *gin.Context)
GetDatasetAssayByAssayID godoc @Summary 按 Assay 查询数据集映射 @Description 返回 Assay 绑定的 DatasetAssay;尚未绑定任何数据集时返回 null @Tags 数据管理 @Produce json @Param assay_id query integer true "Assay 主键 ID" @Success 200 {object} types.DatasetAssay @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-assay/get-by-assay [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) 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) GetFileColumns ¶ added in v0.1.5
func (h *DataHandler) GetFileColumns(c *gin.Context)
GetFileColumns godoc @Summary 获取文件列名 @Description 按文件 ID 读取其列名:tsv/csv 返回扁平的列数组,Excel 返回按 sheet 名分组的列 @Tags 数据管理 @Produce json @Param id query integer 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 /data/file/columns [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) ImportAssayTSV ¶ added in v0.1.5
func (h *DataHandler) ImportAssayTSV(c *gin.Context)
ImportAssayTSV godoc @Summary 通过 TSV 导入 Assay/File @Description 解析 TSV 文本(表头为列名),按 dataset+sample_name+assay_role、assay+文件列 逐级 upsert;未映射的列作为 File 列(FileKey=列名) @Tags 数据管理 @Accept json @Produce json @Param request body types.ImportAssayTSVRequest true "请求参数" @Success 200 {object} types.ImportAssayTSVResult @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/import/assay-tsv [post]
func (*DataHandler) ImportDatasetDirFiles ¶ added in v0.2.0
func (h *DataHandler) ImportDatasetDirFiles(c *gin.Context)
ImportDatasetDirFiles godoc @Summary 批量导入数据集目录文件 @Description 将数据集工作目录(utils.GetDatasetDir)下尚未绑定的文件注册为 go_file 并绑定到数据集;按 path + dataset_id 判重 @Tags 数据管理 @Accept json @Produce json @Param request body importDatasetDirFilesRequest true "请求参数" @Success 200 {object} types.ImportDatasetDirFilesResult @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/import-dir-files [post]
func (*DataHandler) ListAssay ¶ added in v0.1.5
func (h *DataHandler) ListAssay(c *gin.Context)
ListAssay godoc @Summary Assay 列表 @Description 查询 Assay 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.Assay @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/assay/list [get]
func (*DataHandler) ListAssayByProjectID ¶ added in v0.1.5
func (h *DataHandler) ListAssayByProjectID(c *gin.Context)
ListAssayByProjectID godoc @Summary 按当前激活项目查询 Assay 列表 @Description 查询当前用户激活项目下所有样本的 Assay @Tags 数据管理 @Produce json @Success 200 {array} types.AssayWithDatasetInfo @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/assay/list-by-project [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) ListDatasetAssay ¶ added in v0.1.5
func (h *DataHandler) ListDatasetAssay(c *gin.Context)
ListDatasetAssay godoc @Summary 数据集-Assay 映射列表 @Description 查询 DatasetAssay 列表 @Tags 数据管理 @Produce json @Success 200 {array} types.DatasetAssay @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset-assay/list [get]
func (*DataHandler) ListDatasetByProjectID ¶ added in v0.1.5
func (h *DataHandler) ListDatasetByProjectID(c *gin.Context)
ListDatasetByProjectID godoc @Summary 按项目查询数据集列表 @Description 根据当前用户激活的项目查询关联的所有 Dataset @Tags 数据管理 @Produce json @Success 200 {array} types.Dataset @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/dataset/list-by-project [get]
func (*DataHandler) ListDatasetDirFiles ¶ added in v0.2.0
func (h *DataHandler) ListDatasetDirFiles(c *gin.Context)
ListDatasetDirFiles godoc @Summary 列出数据集目录文件 @Description 返回数据集工作目录(utils.GetDatasetDir)路径及其下所有文件;added 表示该文件已通过 path + dataset_id 绑定到数据集 @Tags 数据管理 @Produce json @Param dataset_id query integer true "数据集 ID" @Success 200 {object} types.DatasetDirFilesResponse @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/dir-files [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) ListDatasetFiles ¶ added in v0.2.0
func (h *DataHandler) ListDatasetFiles(c *gin.Context)
ListDatasetFiles godoc @Summary 列出数据集文件 @Description 返回绑定到指定数据集的所有文件(go_dataset_file -> go_file) @Tags 数据管理 @Produce json @Param dataset_id query integer true "数据集 ID" @Success 200 {array} types.FileWithDatasetInfo @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/files [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) ListFileByAnalysisNodeID ¶ added in v0.1.5
func (h *DataHandler) ListFileByAnalysisNodeID(c *gin.Context)
ListFileByAnalysisNodeID godoc @Summary 按分析节点查询文件列表 @Description 返回某个分析节点(analysis_nodes)产出的全部文件,通过 go_file.analysis_node_id 关联(无文件时返回空数组) @Tags 数据管理 @Produce json @Param analysis_node_id query integer true "分析节点主键 ID" @Success 200 {array} types.File @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/list-by-analysis-node [get]
func (*DataHandler) ListFileByAssayID ¶ added in v0.1.5
func (h *DataHandler) ListFileByAssayID(c *gin.Context)
ListFileByAssayID godoc @Summary 按 Assay 查询文件列表 @Description 返回某个 Assay 所拥有的全部文件(无文件时返回空数组) @Tags 数据管理 @Produce json @Param assay_id query integer true "Assay 主键 ID" @Success 200 {array} types.File @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /data/file/list-by-assay [get]
func (*DataHandler) ListFileByProjectID ¶
func (h *DataHandler) ListFileByProjectID(c *gin.Context)
ListFileByProjectID godoc @Summary 按项目查询文件列表 @Description 根据 project_id 查询关联的所有文件;支持按 go_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) PageAssayByProjectID ¶ added in v0.1.5
func (h *DataHandler) PageAssayByProjectID(c *gin.Context)
PageAssayByProjectID godoc @Summary 按项目分页查询 Assay @Description 根据 project_id 分页查询其下的 Assay,并返回所属 dataset 等信息 @Tags 数据管理 @Accept json @Produce json @Param request body assayByProjectPageRequest 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/assay/list-by-project-page [post]
func (*DataHandler) PageDatasetByProjectID ¶
func (h *DataHandler) PageDatasetByProjectID(c *gin.Context)
PageDatasetByProjectID godoc @Summary 按项目分页查询数据集 @Description 根据当前用户激活的项目分页查询关联的 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) PageFileByProjectIDViaAnalysisNode ¶ added in v0.1.5
func (h *DataHandler) PageFileByProjectIDViaAnalysisNode(c *gin.Context)
PageFileByProjectIDViaAnalysisNode godoc @Summary 按当前激活项目分页查询分析节点产出的文件 @Description 根据当前用户激活的项目分页查询由分析节点(analysis_nodes)产出的文件,通过 go_file.analysis_node_id 关联 @Tags 数据管理 @Accept json @Produce json @Param request body types.Pagination 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-analysis-node-page [post]
func (*DataHandler) UpdateAssay ¶ added in v0.1.5
func (h *DataHandler) UpdateAssay(c *gin.Context)
UpdateAssay godoc @Summary 更新 Assay @Description 按 ID 更新 Assay 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.Assay 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/assay/update [post]
func (*DataHandler) UpdateDataset ¶
func (h *DataHandler) UpdateDataset(c *gin.Context)
UpdateDataset godoc @Summary 更新数据集 @Description 按 ID 更新 Dataset 记录,ID 由请求显式指定,其余字段为业务字段 @Tags 数据管理 @Accept json @Produce json @Param request body types.UpdateDatasetRequest 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) UpdateDatasetAssay ¶ added in v0.1.5
func (h *DataHandler) UpdateDatasetAssay(c *gin.Context)
UpdateDatasetAssay godoc @Summary 更新数据集-Assay 映射 @Description 按 ID 更新 DatasetAssay 记录 @Tags 数据管理 @Accept json @Produce json @Param request body types.DatasetAssay 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-assay/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) UploadFileToDataset ¶ added in v0.1.5
func (h *DataHandler) UploadFileToDataset(c *gin.Context)
UploadFileToDataset godoc @Summary 上传本地文件到数据集 @Description 接收 multipart 表单(dataset_id / role / file),把文件保存到数据集工作目录,创建 File 记录并关联到 Dataset @Tags 数据管理 @Accept mpfd @Produce json @Param dataset_id formData integer true "数据集ID" @Param role formData string false "文件角色(go_file.role),默认 DEFAULT" @Param file_name formData string false "展示文件名,默认使用上传文件原名" @Param file formData file 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/upload [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 GitHandler ¶ added in v0.1.5
type GitHandler struct {
// contains filtered or unexported fields
}
GitHandler 暴露组件目录(脚本/工作流本地工作区仓库)的 git 能力。
目前有「查看本地变化 diff」与「撤回单个文件的未提交改动」两组接口(script / workflow), 后续的 git 操作(提交历史 git log、单文件 diff 等)都在本 handler 里扩展: 目录定位复用下方 resolveXxxTarget,读操作复用 internal/utils 里的 git 能力, 不在 WorkflowHandler 里继续堆 git 相关逻辑。
目录布局的推导与 GetScriptById / GetWorkflowById 完全一致:
本地目录 = utils.GetScriptFileDir / utils.GetWorkflowFileDir(baseDir, project.ProjectID, <uuid>) store 目录 = utils.GetWorkflowOrScriptStoreDir(baseDir, store.PathName)(未发布时为空)
注意这里用的是 project.project_id(字符串)而非 script/workflow 的 ProjectID(int64 外键)。
func NewGitHandler ¶ added in v0.1.5
func NewGitHandler(workflowService interfaces.WorkflowService, projectService interfaces.ProjectService, storeService interfaces.StoreService, cfg *config.Config) *GitHandler
func (*GitHandler) GetScriptDiff ¶ added in v0.1.5
func (h *GitHandler) GetScriptDiff(c *gin.Context)
GetScriptDiff godoc @Summary 获取脚本本地变化 diff @Description 按脚本主键定位脚本目录(本地 git 仓库),返回工作区相对 HEAD 的未提交改动(含未跟踪文件)以及本地相对 store 的未发布提交差异;非 git 仓库时 initialized 为 false 且无变化 @Tags Git @Produce json @Param scriptId path string true "脚本主键 ID" @Success 200 {object} handler.gitDiffResponse @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}/git-diff [get]
func (*GitHandler) GetWorkflowDiff ¶ added in v0.1.5
func (h *GitHandler) GetWorkflowDiff(c *gin.Context)
GetWorkflowDiff godoc @Summary 获取工作流本地变化 diff @Description 按工作流主键定位 workflow 目录(本地 git 仓库),返回工作区相对 HEAD 的未提交改动(含未跟踪文件)以及本地相对 store 的未发布提交差异;非 git 仓库时 initialized 为 false 且无变化 @Tags Git @Produce json @Param workflowId path string true "工作流主键 ID" @Success 200 {object} handler.gitDiffResponse @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}/git-diff [get]
func (*GitHandler) RevertScriptFile ¶ added in v0.1.5
func (h *GitHandler) RevertScriptFile(c *gin.Context)
RevertScriptFile godoc @Summary 撤回脚本单个文件的未提交改动 @Description 按脚本主键定位脚本目录,把指定文件恢复为本地 HEAD 版本(等同于 git checkout HEAD -- <path>);文件为工作区新增时删除该文件。仅影响该文件,不产生提交 @Tags Git @Accept json @Produce json @Param scriptId path string true "脚本主键 ID" @Param body body handler.gitRevertFileRequest true "相对仓库根目录的文件路径" @Success 200 {object} handler.gitRevertFileResponse @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/{scriptId}/git-revert-file [post]
func (*GitHandler) RevertWorkflowFile ¶ added in v0.1.5
func (h *GitHandler) RevertWorkflowFile(c *gin.Context)
RevertWorkflowFile godoc @Summary 撤回工作流单个文件的未提交改动 @Description 按工作流主键定位 workflow 目录,把指定文件恢复为本地 HEAD 版本(等同于 git checkout HEAD -- <path>);文件为工作区新增时删除该文件。仅影响该文件,不产生提交 @Tags Git @Accept json @Produce json @Param workflowId path string true "工作流主键 ID" @Param body body handler.gitRevertFileRequest true "相对仓库根目录的文件路径" @Success 200 {object} handler.gitRevertFileResponse @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/{workflowId}/git-revert-file [post]
type ProjectHandler ¶
type ProjectHandler struct {
// contains filtered or unexported fields
}
func NewProjectHandler ¶
func NewProjectHandler(projectService interfaces.ProjectService, cfg *config.Config) *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 创建一条参考文献记录并绑定到当前用户激活项目,全文写入项目 literature 目录下的文件 @Tags 项目 @Accept json @Produce json @Param request body addLiteratureRequest true "请求参数" @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/add-literature [post]
func (*ProjectHandler) AddProjectReport ¶
func (h *ProjectHandler) AddProjectReport(c *gin.Context)
AddProjectReport godoc @Summary 添加项目报告 @Description 向当前用户激活项目添加报告记录,项目ID由后端根据当前用户解析,前端无需传入 @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) AddProjectReportItem ¶ added in v0.1.5
func (h *ProjectHandler) AddProjectReportItem(c *gin.Context)
AddProjectReportItem godoc @Summary 添加报告条目 @Description 向指定报告添加条目。OwnerType 为 analysis/analysis_node/ai_summary 时需提供 OwnerID;同一报告下相同的 owner_type + owner_id 不能重复添加(重复时返回 409)。OwnerType 为 custom(章节占位/自定义内容)时只需提供 title。parent_id 为 0 时挂到根节点。 @Tags 项目 @Accept json @Produce json @Param request body addProjectReportItemRequest true "请求参数" @Success 200 {object} projectReportItemDTO "创建成功" @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 409 {object} errors.AppError "同一报告下已存在相同的 owner_type + owner_id 条目" @Failure 500 {object} errors.AppError @Security Bearer @Router /project/add-project-report-item [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) CommitProjectReport ¶ added in v0.2.0
func (h *ProjectHandler) CommitProjectReport(c *gin.Context)
CommitProjectReport godoc @Summary 提交报告工作目录的改动 @Description 把报告工作目录下的所有改动提交为一个 commit(等同 git add -A + commit);目录尚不是仓库时先初始化,无改动时不产生空提交 @Tags 项目 @Accept json @Produce json @Param request body handler.projectReportGitCommitRequest true "报告ID与可选 commit message" @Success 200 {object} types.ProjectReportCommitResult @Failure 400 {object} errors.AppError @Failure 401 {object} errors.AppError @Failure 404 {object} errors.AppError @Failure 500 {object} errors.AppError @Security Bearer @Router /project/commit-project-report [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) DeleteProjectReportItem ¶ added in v0.1.5
func (h *ProjectHandler) DeleteProjectReportItem(c *gin.Context)
DeleteProjectReportItem godoc @Summary 删除报告条目 @Description 删除指定报告条目(含其所有子孙条目) @Tags 项目 @Accept json @Produce json @Param request body deleteProjectReportItemRequest 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-item [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) GetProjectReportContent ¶ added in v0.1.5
func (h *ProjectHandler) GetProjectReportContent(c *gin.Context)
GetProjectReportContent godoc @Summary 查询报告聚合内容 @Description 汇总报告下所有条目并拼接成正文,返回报告标题与正文 @Tags 项目 @Produce json @Param report_id query int64 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 /project/project-report-content [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) GetProjectReportFile ¶ added in v0.2.0
func (h *ProjectHandler) GetProjectReportFile(c *gin.Context)
GetProjectReportFile godoc @Summary 查询报告自身文件 @Description 读取报告工作目录下的自身 markdown 文件(output.md)内容 @Tags 项目 @Produce json @Param report_id query int64 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 /project/project-report-file [get]
func (*ProjectHandler) GetProjectReportFileHTML ¶ added in v0.2.0
func (h *ProjectHandler) GetProjectReportFileHTML(c *gin.Context)
GetProjectReportFileHTML godoc @Summary 导出报告自身文件为 HTML @Description 将报告工作目录下的 output.md 渲染为独立 HTML 文档;inline_images=true 时图片以 base64 内嵌(自包含),false 时保留原始 URL @Tags 项目 @Produce html @Param report_id query int64 true "报告ID" @Param inline_images query bool false "是否内嵌图片(默认 true)" @Success 200 {string} string "HTML 文档" @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-file-html [get]
func (*ProjectHandler) GetProjectReportGitDiff ¶ added in v0.2.0
func (h *ProjectHandler) GetProjectReportGitDiff(c *gin.Context)
GetProjectReportGitDiff godoc @Summary 获取报告工作目录的本地变化 @Description 按报告ID定位报告工作目录(本地 git 仓库),返回工作区相对 HEAD 的未提交改动(含未跟踪文件);非 git 仓库时 initialized 为 false 且无变化 @Tags 项目 @Produce json @Param report_id query int64 true "报告ID" @Success 200 {object} types.ProjectReportGitDiff @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-git-diff [get]
func (*ProjectHandler) GetProjectReportHTML ¶ added in v0.1.5
func (h *ProjectHandler) GetProjectReportHTML(c *gin.Context)
GetProjectReportHTML godoc @Summary 导出报告为 HTML @Description 将当前用户报告聚合为独立 HTML 文档;inline_images=true 时图片以 base64 内嵌(自包含),false 时保留原始 URL @Tags 项目 @Produce html @Param report_id query int64 true "报告ID" @Param inline_images query bool false "是否内嵌图片(默认 true)" @Success 200 {string} string "HTML 文档" @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-html [get]
func (*ProjectHandler) GetProjectReportItemContent ¶ added in v0.1.5
func (h *ProjectHandler) GetProjectReportItemContent(c *gin.Context)
GetProjectReportItemContent godoc @Summary 查询报告条目 markdown 内容 @Description 入参为 ProjectReportItem ID,返回该条目解析后的 markdown 内容 @Tags 项目 @Produce json @Param id query int64 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 /project/project-report-item-content [get]
func (*ProjectHandler) GetProjectReportItemDetail ¶ added in v0.1.5
func (h *ProjectHandler) GetProjectReportItemDetail(c *gin.Context)
GetProjectReportItemDetail godoc @Summary 查询报告条目详情 @Description 根据 id 查询条目详情,File 类型会返回文件内容 @Tags 项目 @Produce json @Param id query int64 true "条目ID" @Success 200 {object} projectReportItemDTO @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-item-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) ListProjectReportItem ¶ added in v0.1.5
func (h *ProjectHandler) ListProjectReportItem(c *gin.Context)
ListProjectReportItem godoc @Summary 查询报告条目树 @Description 查询指定报告下的所有条目,并按其 parent_id 组装成树返回 @Tags 项目 @Produce json @Param report_id query int64 true "报告ID" @Success 200 {array} projectReportItemNode @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-item [get]
func (*ProjectHandler) PackageProjectReportItem ¶ added in v0.2.0
func (h *ProjectHandler) PackageProjectReportItem(c *gin.Context)
PackageProjectReportItem godoc @Summary 打包报告条目树内容 @Description 把报告条目树按层级导出到报告工作目录的 results 子目录:目录名即条目标题;custom 写入 README.md,analysis_node 拷贝节点输出目录,ai_summary 拷贝摘要正文文件,analysis 暂不处理。重复调用会覆盖上一次的打包结果。 @Tags 项目 @Produce json @Param report_id query int64 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 /project/package-project-report-item [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) ReorderProjectReportItem ¶ added in v0.1.5
func (h *ProjectHandler) ReorderProjectReportItem(c *gin.Context)
ReorderProjectReportItem godoc @Summary 重排报告条目树 @Description 按前端拖拽结果批量更新条目的 parent_id 与 sort_order,实现树形结构的移动与排序 @Tags 项目 @Accept json @Produce json @Param request body reorderProjectReportItemRequest 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/reorder-project-report-item [post]
func (*ProjectHandler) RevertProjectReportFile ¶ added in v0.2.0
func (h *ProjectHandler) RevertProjectReportFile(c *gin.Context)
RevertProjectReportFile godoc @Summary 撤回报告目录单个文件的未提交改动 @Description 按报告ID定位报告工作目录,把指定文件恢复为本地 HEAD 版本(等同 git checkout HEAD -- <path>);文件为工作区新增时删除该文件。仅影响该文件,不产生提交 @Tags 项目 @Accept json @Produce json @Param request body handler.projectReportGitRevertFileRequest true "报告ID与相对报告目录的文件路径" @Success 200 {object} map[string]interface{} @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 /project/revert-project-report-file [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更新标题,并将全文写到项目 literature 目录下的文件 @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更新当前用户激活项目下的报告,项目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) UpdateProjectReportFile ¶ added in v0.2.0
func (h *ProjectHandler) UpdateProjectReportFile(c *gin.Context)
UpdateProjectReportFile godoc @Summary 更新报告自身文件 @Description 覆写报告工作目录下的自身 markdown 文件(output.md)内容 @Tags 项目 @Accept json @Produce json @Param request body updateProjectReportFileRequest 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-file [post]
func (*ProjectHandler) UpdateProjectReportItem ¶ added in v0.1.5
func (h *ProjectHandler) UpdateProjectReportItem(c *gin.Context)
UpdateProjectReportItem godoc @Summary 更新报告条目 @Description 更新条目的排序、父节点或 owner 绑定;若变更 owner 后与同报告内其他条目重复则返回 409 @Tags 项目 @Accept json @Produce json @Param request body updateProjectReportItemRequest true "请求参数" @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 "同一报告下已存在相同的 owner_type + owner_id 条目" @Failure 500 {object} errors.AppError @Security Bearer @Router /project/update-project-report-item [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 ProjectReportItemVar ¶ added in v0.2.0
ProjectReportItemVar 是暴露给 pongo2 模板遍历的项目报告条目变量。 每个条目包含名称(Name)、内容(Content)与来源类型(OwnerType):
- analysis / analysis_node:名称取 AnalysisName / NodeName,内容为 Analysis 工作目录 / 节点输出目录下的 output.md 文件路径;
- ai_summary:名称取摘要标题,内容为摘要文件路径(见 utils.GetAISummaryFile);
- custom:名称取用户编辑的标题,内容为用户编辑的正文。
OwnerType 为条目原始来源类型(取值见 types.ProjectReportItemOwnerType),供模板按来源 区分处理(如 {% if item.OwnerType == "ai_summary" %})。
字段刻意不加 json tag:SystemPromptVars 会随 agent_tasks.request 一起 JSON 往返, 不加 tag 时字段名即 JSON 键(Name/Content/OwnerType),无论内存态还是反序列化后, 模板都能统一用 {{ item.Name }} / {{ item.Content }} / {{ item.OwnerType }} 访问。
OwnerType 特意声明为 string,而不是 types.ProjectReportItemOwnerType:pongo2 的 `==` 最终走 Go 的接口相等比较(见 pongo2.Value.EqualValueTo,仅整数/时间有特例), 动态类型不同即判定不相等,具名字符串类型永远不等于字符串字面量。一旦这里保留具名 类型,内存态渲染时 {% if item.OwnerType == "custom" %} 恒为假,循环体整段不输出; 而经 JSON 往返后的副本(agent_tasks 恢复)却变回 string 又能命中,同一模板出现 「首次不输出、恢复后正常」的诡异差异。构建时用 string(...) 显式转换即规避此坑。
type ProxyHandler ¶
type ProxyHandler struct {
// contains filtered or unexported fields
}
func NewProxyHandler ¶
func NewProxyHandler(cfg *config.Config, resolver route.PathRouteResolver) (*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 PublishWorkflowRequest ¶
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 Resolved ¶ added in v0.2.0
type Resolved struct {
Context *RuntimeContext
WorkingDir string
}
Resolved 是一次业务 env 的解析结果。
RuntimeContext 只承载业务变量;工作目录属于执行事实,由调用方写入 TaskFacts (最终落到 Task.WorkingDir),不再重复存放在 RuntimeContext 里。
type RuntimeContext ¶ added in v0.1.2
type RuntimeContext = runtimecontext.RuntimeContext
RuntimeContext 是解析后的运行时上下文。
直接复用 runtimecontext.RuntimeContext:它只承载可序列化的业务事实(渲染 Profile 系统提示词模板 所需的 SystemPromptVars),随 TurnInput → agenttypes.Request.RuntimeContext 一路 传递到工具执行期,并随 Request 一起序列化进 agent_tasks.request 持久化(重启后可恢复)。 工作目录属于执行事实,由 ResolveWithFacts 返回并落到 Task.WorkingDir。
工具执行期所需的服务能力(如 AnalysisNodeRunner)不在此结构内:它是进程级静态依赖, 改由 agentclient.Options 注入(见 buildAgentClient),避免服务对象被序列化进 agent_tasks。
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"` // 用当前用户 Profile 模板渲染后的真实系统提示词
Vars map[string]any `json:"vars,omitempty"` // 渲染系统提示词模板所用的变量
ProfileName string `json:"profile_name,omitempty"` // 用于渲染系统提示词的 Profile 名称
ProfileID int64 `json:"profile_id,omitempty,string"` // 用于渲染系统提示词的 Profile ID
// Skills 是 Profile 启用的技能名列表(见 Profile.Skills)。
// 不加 omitempty:空数组表示「不限制技能」(Profile 未配置技能时使用全部技能),
// 与「没有 Profile」区分开,前端据此展示 Skills 区域。
Skills []string `json:"skills"`
}
RuntimeContextInfo 是用于前端展示的轻量上下文描述。
type RuntimeContextResolver ¶ added in v0.1.2
type RuntimeContextResolver struct {
// contains filtered or unexported fields
}
RuntimeContextResolver 把「业务 env(type,id) → 系统提示词 + 工作目录」的解析逻辑 从具体 Handler 中抽离出来,供 Agent 会话(AgentHandler)使用,避免重复实现导致的行为漂移。
func NewRuntimeContextResolver ¶ added in v0.1.2
func NewRuntimeContextResolver( cfg *config.Config, projectSvc interfaces.ProjectService, workflowSvc interfaces.WorkflowService, analysisSvc interfaces.AnalysisService, summarySvc interfaces.AISummaryService, agentSvc *agentservice.AgentService, ) *RuntimeContextResolver
NewRuntimeContextResolver 创建运行时上下文解析器。
func (*RuntimeContextResolver) Describe ¶ added in v0.1.2
func (r *RuntimeContextResolver) Describe(ctx context.Context, userID int64, profileID int64, env map[string]any) (*RuntimeContextInfo, error)
Describe 解析 env 并返回用于前端展示的上下文描述。
与 Resolve 共享同一套解析逻辑:先用 env 解析出 SystemPromptVars,再按当前用户选中的 Profile(profileID)解析其系统提示词模板,用变量渲染出真正的系统提示词。
func (*RuntimeContextResolver) Resolve ¶ added in v0.1.2
func (r *RuntimeContextResolver) Resolve(ctx context.Context, userID int64, env map[string]any) (*Resolved, error)
Resolve 根据 env 解析出系统提示词模板变量与工作目录。
它不再返回拼装好的系统提示词,而是返回 SystemPromptVars;真正的系统提示词由 AgentService 依据 Profile 模板渲染(见 applyProfile / RenderSystemPrompt)。
env 为 nil 或 type 为空时,回退到当前用户激活项目的默认工作目录。
func (*RuntimeContextResolver) ResolveWithFacts ¶ added in v0.2.0
func (r *RuntimeContextResolver) ResolveWithFacts(ctx context.Context, userID int64, env map[string]any) (*RuntimeContext, agenttypes.TaskFacts, error)
ResolveWithFacts 解析业务上下文,并返回本次调用的执行事实(用户 / 项目 / 工作目录)。
会话 ID 由上层按具体会话补齐;工具通过 Runtime 注入的 TaskFacts 读取这些事实, 不再从 RuntimeContext 里取。
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 根据 go_file 主键 ID 查找文件 path,由 path 后缀推断读取格式(前端无需传递 format),再读取工作簿并转换为 Univer 可用结构。结果中附带文件信息;不支持的格式返回“页面不支持预览”。 @Tags 表格 @Produce json @Param id query integer true "文件主键 ID" @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 根据 go_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) GetStoreImage ¶ added in v0.1.4
func (h *StoreHandler) GetStoreImage(c *gin.Context)
GetStoreImage godoc @Summary 获取商店封面图片流 @Description 根据 int64 主键读取商店封面,位置固定为 {base_dir}/store/{path_name}/{store_type}/{img}; @Description 文件不存在或路径非法时返回内置占位图(200 + image/svg+xml)。 @Tags 商店 @Produce image/svg+xml @Param storeId path int64 true "商店主键 ID(int64)" @Success 200 {file} binary "图片流或占位图" @Failure 400 {object} errors.AppError "参数错误" @Failure 401 {object} errors.AppError "未认证" @Failure 404 {object} errors.AppError "商店不存在" @Failure 500 {object} errors.AppError "服务器错误" @Security Bearer @Router /store/{storeId}/image [get]
func (*StoreHandler) ListStore ¶
func (h *StoreHandler) ListStore(c *gin.Context)
func (*StoreHandler) PageStore ¶
func (h *StoreHandler) PageStore(c *gin.Context)
func (*StoreHandler) PublishStoreRemote ¶ added in v0.1.5
func (h *StoreHandler) PublishStoreRemote(c *gin.Context)
PublishStoreRemote 把 store 发布到远程仓库(github / gitee 等,可配置多个)。
做三件事:
- 校验 store_id / url(url 复用下载侧的 git 地址校验,必须是 <owner>/<repo> 形态);
- 打开 store 裸仓库,把 url 写成 remote(按主机名命名 github / gitee / gitlab ..., 同名冲突时追加序号),同一个 url 已配置过则跳过添加;
- 把 store 裸仓库的当前分支推送到该 remote(force 覆盖远端同名分支),并返回仓库当前的 remote 列表与本次推送结果,便于前端刷新展示。
之所以写 git remote 而不是数据库列:地址只有一份真实来源(仓库配置), 数据库副本极易与实际仓库状态漂移;store 表已删除 url 列。
已配置过的 url(added=false)也会继续执行 push —— 「改了组件再发布一次」正是主路径。 推送凭据走 utils.ResolveGitAuth 的零配置约定(https 地址里的用户名密码、ssh-agent、 $GIT_SSH_KEY 指定的私钥或 ~/.ssh 下的默认私钥), 认证失败等底层错误以 500 + details 返回。
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 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:"workflow_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"`
OutputFiles []map[string]interface{} `json:"output_files"`
CacheFiles []map[string]interface{} `json:"cache_files"`
}
type WorkflowFormJSONResponse ¶
type WorkflowFormJSONResponse struct {
Type string `json:"type"`
FormJSON []interface{} `json:"formJson"`
}
type WorkflowFormResponse ¶
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, exportCodecs *exportcodec.Registry, 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) GetScriptImage ¶ added in v0.1.4
func (h *WorkflowHandler) GetScriptImage(c *gin.Context)
GetScriptImage godoc @Summary 获取脚本组件封面图片流 @Description 根据 int64 主键读取脚本目录下的封面图片;图片不存在时返回内置占位图(200 + image/svg+xml)。 @Tags 工作流 @Produce image/svg+xml @Param scriptId path int64 true "脚本主键 ID(int64)" @Success 200 {file} binary "图片流或占位图" @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}/image [get]
func (*WorkflowHandler) GetScriptReadme ¶ added in v0.1.5
func (h *WorkflowHandler) GetScriptReadme(c *gin.Context)
GetScriptReadme godoc @Summary 获取脚本 README @Description 读取脚本目录(GetScriptFileDir)下的 README.md;文件不存在时返回空 content @Tags 工作流 @Produce json @Param scriptId path string true "脚本主键 ID" @Success 200 {object} handler.readmeResponse @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}/readme [get]
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) GetWorkflowImage ¶ added in v0.1.4
func (h *WorkflowHandler) GetWorkflowImage(c *gin.Context)
GetWorkflowImage godoc @Summary 获取工作流封面图片流 @Description 根据 int64 主键读取 workflow 目录下的封面图片;图片不存在时返回内置占位图(200 + image/svg+xml)。 @Tags 工作流 @Produce image/svg+xml @Param workflowId path int64 true "工作流主键 ID(int64)" @Success 200 {file} binary "图片流或占位图" @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}/image [get]
func (*WorkflowHandler) GetWorkflowReadme ¶ added in v0.1.5
func (h *WorkflowHandler) GetWorkflowReadme(c *gin.Context)
GetWorkflowReadme godoc @Summary 获取工作流 README @Description 读取工作流目录(GetWorkflowFileDir)下的 README.md;文件不存在时返回空 content @Tags 工作流 @Produce json @Param workflowId path string true "工作流主键 ID" @Success 200 {object} handler.readmeResponse @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}/readme [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 时更新记录,否则创建新记录;更新时以数据库已有记录为基准,只覆盖请求中有值的字段(未提交的 store_id/url/message 等保持原值);同时把 io_schema、脚本主文件与 script.json 写入脚本目录(script.json 只落盘、不提交 git)。生成导出文件并提交版本由 POST /workflow/save-script-files(SaveScriptFiles)负责 @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) SaveScriptContent ¶ added in v0.1.5
func (h *WorkflowHandler) SaveScriptContent(c *gin.Context)
SaveScriptContent godoc @Summary 保存脚本文件内容 @Description 按 scriptId 覆盖写入脚本主文件(文件名由 script_type 决定),随后重新生成 script.json 并提交脚本目录改动(与 SaveScript 共用导出 Codec) @Tags 工作流 @Accept json @Produce json @Param scriptId path string true "脚本主键 ID" @Param request body handler.saveScriptContentRequest 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 /script/{scriptId}/content [post]
func (*WorkflowHandler) SaveScriptFiles ¶ added in v0.1.5
func (h *WorkflowHandler) SaveScriptFiles(c *gin.Context)
SaveScriptFiles godoc @Summary 生成脚本导出文件并提交 @Description 按主键重新生成 script.json 落盘到脚本目录,并把脚本目录的本地改动提交为一个 git commit(本地目录不存在则初始化);commit_message 可选,为空时使用默认文案 save script <scriptID> @Tags 工作流 @Accept json @Produce json @Param request body handler.saveScriptFilesRequest 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 /workflow/save-script-files [post]
func (*WorkflowHandler) SaveScriptReadme ¶ added in v0.1.5
func (h *WorkflowHandler) SaveScriptReadme(c *gin.Context)
SaveScriptReadme godoc @Summary 保存脚本 README @Description 覆盖写入脚本目录(GetScriptFileDir)下的 README.md,并提交该目录的 git 改动 @Tags 工作流 @Accept json @Produce json @Param scriptId path string true "脚本主键 ID" @Param request body handler.saveReadmeRequest true "请求参数" @Success 200 {object} handler.readmeResponse @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}/readme [post]
func (*WorkflowHandler) SaveWorkflow ¶
func (h *WorkflowHandler) SaveWorkflow(c *gin.Context)
SaveWorkflow godoc @Summary 保存工作流 @Description 保存 workflow 组件:当请求包含 id 时更新记录,否则创建新记录;更新时以数据库已有记录为基准,只覆盖请求中有值的字段(未提交的 store_id/url/message 等保持原值);同时把 workflow.json(含脚本目录快照)写入 workflow 目录(只落盘、不提交 git)。生成导出文件并提交版本由 POST /workflow/save-workflow-files(SaveWorkflowFiles)负责 @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]
func (*WorkflowHandler) SaveWorkflowDag ¶ added in v0.1.4
func (h *WorkflowHandler) SaveWorkflowDag(c *gin.Context)
SaveWorkflowDag godoc @Summary 保存工作流 DAG 定义 @Description 按 id 仅更新 workflow 的 dag_definition 字段;workflow_id 为 workflow 表 int64 主键,name/tags/store_id 等其他字段保持不变 @Tags 工作流 @Accept json @Produce json @Param request body handler.saveWorkflowDagRequest 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 /workflow/save-workflow-dag [post]
func (*WorkflowHandler) SaveWorkflowFiles ¶ added in v0.1.5
func (h *WorkflowHandler) SaveWorkflowFiles(c *gin.Context)
SaveWorkflowFiles godoc @Summary 生成工作流导出文件并提交 @Description 按主键重新生成 workflow.json(含引用的脚本目录快照)落盘到 workflow 目录,并把该目录的本地改动提交为一个 git commit(本地目录不存在则初始化);commit_message 可选,为空时使用默认文案 save workflow <workflowID> @Tags 工作流 @Accept json @Produce json @Param request body handler.saveWorkflowFilesRequest 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 /workflow/save-workflow-files [post]
func (*WorkflowHandler) SaveWorkflowReadme ¶ added in v0.1.5
func (h *WorkflowHandler) SaveWorkflowReadme(c *gin.Context)
SaveWorkflowReadme godoc @Summary 保存工作流 README @Description 覆盖写入工作流目录(GetWorkflowFileDir)下的 README.md,并提交该目录的 git 改动 @Tags 工作流 @Accept json @Produce json @Param workflowId path string true "工作流主键 ID" @Param request body handler.saveReadmeRequest true "请求参数" @Success 200 {object} handler.readmeResponse @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}/readme [post]
func (*WorkflowHandler) ScriptToNode ¶ added in v0.1.4
func (h *WorkflowHandler) ScriptToNode(c *gin.Context)
ScriptToNode godoc @Summary 获取添加到节点的 script 数据 @Description 参考 python 版 /tools/script-to-node/{component_id}/{relation_id}:根据 scriptId 与 workflowId 生成带唯一 node_id 的 script 节点,供前端画布 addNode 使用 @Tags 工作流 @Produce json @Param scriptId query int64 true "Script 主键 ID" @Param workflowId query int64 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 /workflow/script-to-node [get]
func (*WorkflowHandler) UploadScriptImage ¶ added in v0.1.4
func (h *WorkflowHandler) UploadScriptImage(c *gin.Context)
UploadScriptImage godoc @Summary 上传脚本组件封面 @Description multipart/form-data 上传(字段名 file)。保存到脚本目录下的 image.<原图后缀>, @Description 并把纯文件名写入 pipeline_components.img。scriptId 为 int64 主键。 @Tags 工作流 @Accept mpfd @Produce json @Param scriptId path int64 true "脚本主键 ID(int64)" @Param file formData file true "图片文件" @Success 200 {object} map[string]interface{} "上传成功,返回 url/img/name" @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}/image [post]
func (*WorkflowHandler) UploadWorkflowImage ¶ added in v0.1.4
func (h *WorkflowHandler) UploadWorkflowImage(c *gin.Context)
UploadWorkflowImage godoc @Summary 上传工作流封面 @Description multipart/form-data 上传(字段名 file)。保存到 workflow 目录下的 image.<原图后缀>, @Description 并把纯文件名写入 pipeline_components_relation.img。workflowId 为 int64 主键。 @Tags 工作流 @Accept mpfd @Produce json @Param workflowId path int64 true "工作流主键 ID(int64)" @Param file formData file true "图片文件" @Success 200 {object} map[string]interface{} "上传成功,返回 url/img/name" @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}/image [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"`
// ContainerTemplateSpecs / ContainerTemplateDefinitions 都是按主键去重后的
// 导出列表:绑定行通过 spec_id 引用运行配置,镜像名与拉取策略直接挂在绑定行上。
ContainerTemplateSpecs []map[string]any `json:"container_template_specs"`
ContainerTemplateDefinitions []map[string]any `json:"container_template_definitions"`
}
Source Files
¶
- agent.go
- agent_runtime_context.go
- ai_summary.go
- analysis.go
- analysis_command_node.go
- analysis_publish.go
- analysis_request_parser.go
- analysis_terminal.go
- auth.go
- config.go
- container.go
- container_provision.go
- container_terminal.go
- convert.go
- data.go
- file.go
- git.go
- onlyoffice.go
- project.go
- project_report_git.go
- project_report_html.go
- project_report_item.go
- proxy.go
- realtime.go
- script_init.go
- setting.go
- sheet.go
- static.go
- store.go
- store_remote.go
- terminal_bridge.go
- upload.go
- workflow.go
- workflow_files.go
- workflow_form_builder.go
- workflow_publish.go
- workflow_readme.go
- workflow_script_img.go