definitions: handler.LoginRequest: properties: password: type: string username: type: string required: - password - username type: object handler.LoginResponse: properties: token: type: string user: {} type: object handler.RegisterRequest: properties: email: type: string password: type: string username: type: string required: - password - username type: object model.CPUInfo: properties: core_count: description: 核心数 type: integer model_name: description: CPU型号 type: string percent: description: CPU使用率 type: number type: object model.CheckRequest: properties: charset: type: string database: type: string database_id: description: 可选,用于获取已保存的字段映射 type: string db_type: type: string host: type: string password: type: string port: type: integer ssl_mode: type: string uri: description: Neo4j 连接地址,如 bolt://localhost:7687 type: string username: type: string required: - db_type - host - port - username type: object model.CreateDatabaseRequest: properties: charset: type: string database: type: string db_type: type: string description: type: string host: type: string name: type: string password: type: string port: type: integer ssl_mode: type: string sub_tables: description: 可选,子表配置 items: $ref: '#/definitions/model.CreateSubTableRequest' type: array username: type: string required: - db_type - host - name - port - username type: object model.CreateKnowledgeRequest: properties: description: type: string embedding_model_id: type: string llm_model_id: type: string name: type: string parsing_config: $ref: '#/definitions/model.ParsingConfig' storage_config: allOf: - $ref: '#/definitions/model.StorageConfig' description: 存储配置,不传则使用全局配置 required: - embedding_model_id - llm_model_id - name - parsing_config type: object model.CreateModelRequest: properties: api_endpoint: type: string api_key: type: string base_url: type: string model: type: string model_type: type: string name: type: string provider: type: string status: type: string required: - api_key - base_url - model - model_type - name - provider type: object model.CreateSubTableRequest: properties: database_id: type: string ddl: description: 建表DDL type: string fields: description: 字段映射列表 items: $ref: '#/definitions/model.FieldMapping' type: array mapping_type: type: string parent_table: type: string relation_field: type: string relation_type: type: string sub_table_comment: type: string sub_table_name: type: string required: - database_id - parent_table - sub_table_name type: object model.DatabaseInfo: properties: charset: description: 连接选项 type: string created_at: description: 时间 type: string database: description: 数据库名 type: string db_type: description: '数据库类型: mysql, postgres, mongodb, neo4j等' type: string description: description: 描述 type: string graph_labels: description: Neo4j 标签列表 (JSON 格式) type: string graph_relationship: description: Neo4j 关系类型列表 (JSON 格式) type: string host: description: 主机地址 type: string id: description: UUID type: string name: description: 数据库名称 type: string password: description: 密码(建议加密存储) type: string port: description: 端口 type: integer selected_label: description: 当前选中的标签 type: string ssl_mode: description: SSL模式 type: string table_count: description: 子表数量 type: integer updated_at: type: string uri: description: Neo4j 专用字段 type: string username: description: 用户名 type: string type: object model.FieldMapping: properties: column_name: description: 列名 type: string mapped_name: description: 中文映射名 type: string type: object model.MemoryInfo: properties: available: description: 可用(字节) type: integer available_gb: description: 可用(GB) type: number percent: description: 使用率 type: number total: description: 总内存(字节) type: integer total_gb: description: 总内存(GB) type: number used: description: 已使用(字节) type: integer used_gb: description: 已使用(GB) type: number type: object model.ModelInfo: properties: api_endpoint: description: API 端点路径 type: string api_key: description: API 密钥 type: string base_url: description: 基础 URL type: string created_at: type: string id: type: string model: description: 模型标识 type: string model_type: description: chat/embedding/rerank/vlm type: string name: type: string provider: description: OpenAI/Ollama type: string status: description: active/inactive type: string updated_at: type: string type: object model.Neo4jCheckRequest: properties: database: description: 可选,默认 neo4j type: string description: description: 可选,数据库描述 type: string host: type: string name: description: 数据库名称 type: string password: type: string port: type: integer uri: description: 可选,Neo4j 连接地址 (bolt://host:7687) type: string username: type: string required: - host - password - port - username type: object model.Neo4jGraphRequest: properties: database: description: 可选,默认 neo4j type: string password: type: string uri: type: string username: type: string required: - password - uri - username type: object model.Neo4jNodeRequest: properties: database: type: string label: type: string limit: description: 默认 10 type: integer password: type: string uri: type: string username: type: string required: - label - password - uri - username type: object model.Neo4jRelRequest: properties: database: type: string limit: description: 默认 10 type: integer password: type: string relationship_type: type: string uri: type: string username: type: string required: - password - relationship_type - uri - username type: object model.ParsingConfig: properties: docling_url: description: Docling 服务 URL type: string enable_pdf: description: 是否启用 PDF 解析 type: boolean engine: description: markitdown / docling type: string pandoc: description: 是否启用 Pandoc type: boolean vlm_api_key: description: API Key type: string vlm_base_url: description: 自定义 API 地址 type: string vlm_enabled: description: VLM 配置(用于图片 OCR 等) type: boolean vlm_model: description: 模型名称 type: string vlm_prompt: description: 自定义提示词 type: string vlm_provider: description: 'VLM 提供商: openai, anthropic, local 等' type: string type: object model.SaveGraphRequest: properties: databaseId: type: string databaseName: type: string labels: items: type: string type: array relationshipTypes: items: type: string type: array selectedLabel: type: string uri: type: string username: type: string required: - databaseId - databaseName - labels - relationshipTypes - uri - username type: object model.StorageConfig: properties: access_key_id: description: MinIO/S3 access key type: string bucket: description: MinIO/S3 bucket type: string endpoint: description: MinIO/S3 endpoint type: string secret_access_key: description: MinIO/S3 secret key type: string type: description: local / minio / s3 type: string use_ssl: description: MinIO/S3 use SSL type: boolean type: object model.SubTableInfo: properties: created_at: type: string database_id: description: 关联的数据库ID type: string ddl: description: 建表 DDL type: string fields: description: 字段映射列表(返回给前端) items: $ref: '#/definitions/model.FieldMapping' type: array id: description: UUID type: string mapping_type: description: 映射类型 type: string parent_table: description: 父表名 type: string relation_field: description: 关联字段 type: string relation_type: description: 关联类型 type: string sub_table_comment: description: 子表注释 type: string sub_table_name: description: 子表名 type: string updated_at: type: string type: object model.SystemInfo: properties: cpu: $ref: '#/definitions/model.CPUInfo' memory: $ref: '#/definitions/model.MemoryInfo' type: object model.TestModelRequest: properties: api_endpoint: type: string api_key: type: string base_url: type: string model: type: string model_type: type: string provider: type: string required: - api_key - base_url - model - model_type - provider type: object model.UpdateDatabaseRequest: properties: charset: type: string database: type: string db_type: type: string description: type: string graph_labels: description: Neo4j 标签列表 (JSON) type: string graph_relationship: description: Neo4j 关系类型列表 (JSON) type: string host: type: string name: type: string password: type: string port: type: integer selected_label: description: 当前选中的标签 type: string ssl_mode: type: string sub_tables: description: 子表配置 items: $ref: '#/definitions/model.CreateSubTableRequest' type: array table_count: type: integer uri: description: Neo4j 连接地址 type: string username: type: string type: object model.UpdateKnowledgeRequest: properties: description: type: string embedding_model_id: type: string llm_model_id: type: string name: type: string parsing_config: $ref: '#/definitions/model.ParsingConfig' status: type: string storage_config: $ref: '#/definitions/model.StorageConfig' type: object model.UpdateModelRequest: properties: api_endpoint: type: string api_key: type: string base_url: type: string model: type: string model_type: type: string name: type: string provider: type: string status: type: string type: object model.UpdateSubTableRequest: properties: ddl: type: string mapping_type: type: string parent_table: type: string relation_field: type: string relation_type: type: string sub_table_comment: type: string sub_table_name: type: string type: object info: contact: {} paths: /api/file_proxy: get: consumes: - application/json description: 代理访问文件,解决 MinIO 内网和 HTTPS 问题 parameters: - description: 文件Key in: query name: key required: true type: string - description: 知识库ID in: query name: kb_id type: string produces: - application/octet-stream responses: "200": description: OK schema: type: file "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 代理文件访问 tags: - 文件上传 /api/file_upload: post: consumes: - multipart/form-data description: 上传文件到服务器(本地存储或MinIO) parameters: - description: 要上传的文件 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 上传文件 tags: - 文件上传 /api/file_upload/{filename}: delete: consumes: - application/json description: 删除指定文件 parameters: - description: 文件名 in: path name: filename required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 删除文件 tags: - 文件上传 /api/knowledge/{id}: delete: consumes: - application/json description: 删除指定的知识库 parameters: - description: 知识库ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 删除知识库 tags: - 知识库 get: consumes: - application/json description: 根据ID获取知识库详细信息 parameters: - description: 知识库ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: 获取知识库详情 tags: - 知识库 put: consumes: - application/json description: 更新指定知识库的信息 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 更新信息 in: body name: request required: true schema: $ref: '#/definitions/model.UpdateKnowledgeRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 更新知识库 tags: - 知识库 /api/knowledge/{id}/documents: get: consumes: - application/json description: 获取指定知识库下的所有文档 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 文档状态筛选 in: query name: status type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取知识库文档列表 tags: - 知识库 post: consumes: - multipart/form-data description: 上传文档到指定知识库 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 文档文件 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 上传文档 tags: - 知识库 /api/knowledge/{id}/documents/{doc_id}: delete: consumes: - application/json description: 删除知识库中的指定文档 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 文档ID in: path name: doc_id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 删除文档 tags: - 知识库 /api/knowledge/{id}/documents/{doc_id}/preview: get: consumes: - application/json description: 获取文档的解析预览内容 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 文档ID in: path name: doc_id required: true type: string - description: 页码 in: query name: page type: integer produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取文档预览 tags: - 知识库 /api/knowledge/{id}/documents/{doc_id}/reparse: post: consumes: - application/json description: 重新解析指定文档(用于更新解析结果) parameters: - description: 知识库ID in: path name: id required: true type: string - description: 文档ID in: path name: doc_id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 重新解析文档 tags: - 知识库 /api/knowledge/create: post: consumes: - application/json description: 创建一个新的知识库 parameters: - description: 知识库信息 in: body name: request required: true schema: $ref: '#/definitions/model.CreateKnowledgeRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object summary: 创建知识库 tags: - 知识库 /api/knowledge/list: get: consumes: - application/json description: 获取所有知识库列表 produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取知识库列表 tags: - 知识库 /auth/login: post: consumes: - application/json description: 用户登录并获取 JWT Token parameters: - description: 登录请求 in: body name: request required: true schema: $ref: '#/definitions/handler.LoginRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/handler.LoginResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object "401": description: Unauthorized schema: additionalProperties: type: string type: object summary: 用户登录 tags: - 认证 /auth/me: get: consumes: - application/json description: 获取已登录用户的详细信息 produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "401": description: Unauthorized schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: 获取当前用户信息 tags: - 认证 /auth/register: post: consumes: - application/json description: 新用户注册账号 parameters: - description: 注册请求 in: body name: RegisterRequest required: true schema: $ref: '#/definitions/handler.RegisterRequest' produces: - application/json responses: "201": description: Created schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object summary: 用户注册 tags: - 认证 /database/{id}: delete: consumes: - application/json description: 删除指定的数据库连接 parameters: - description: 数据库ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: 删除数据库 tags: - 数据库管理 get: consumes: - application/json description: 根据ID获取数据库详细信息 parameters: - description: 数据库ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/model.DatabaseInfo' "404": description: Not Found schema: additionalProperties: type: string type: object summary: 获取数据库详情 tags: - 数据库管理 put: consumes: - application/json description: 更新指定数据库的信息 parameters: - description: 数据库ID in: path name: id required: true type: string - description: 更新信息 in: body name: request required: true schema: $ref: '#/definitions/model.UpdateDatabaseRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/model.DatabaseInfo' "400": description: Bad Request schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: 更新数据库信息 tags: - 数据库管理 /database/add: post: consumes: - application/json description: 添加新的数据库连接信息 parameters: - description: 数据库信息 in: body name: request required: true schema: $ref: '#/definitions/model.CreateDatabaseRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/model.DatabaseInfo' "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 创建数据库 tags: - 数据库管理 /database/check: post: consumes: - application/json description: 测试数据库连接是否正常 parameters: - description: 数据库连接信息 in: body name: request required: true schema: $ref: '#/definitions/model.CheckRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 检查数据库连接 tags: - 数据库管理 /database/graph/save: post: consumes: - application/json description: 保存数据库的图谱结构信息 parameters: - description: 图谱信息 in: body name: request required: true schema: $ref: '#/definitions/model.SaveGraphRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 保存图谱信息 tags: - 数据库管理 /database/list: get: consumes: - application/json description: 获取所有已添加的数据库列表 produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取数据库列表 tags: - 数据库管理 /model/{id}: delete: consumes: - application/json description: 删除指定的AI模型 parameters: - description: 模型ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: type: boolean type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 删除模型 tags: - 模型管理 get: consumes: - application/json description: 根据ID获取模型详细信息 parameters: - description: 模型ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/model.ModelInfo' "404": description: Not Found schema: additionalProperties: type: string type: object summary: 获取模型详情 tags: - 模型管理 put: consumes: - application/json description: 更新指定模型的信息 parameters: - description: 模型ID in: path name: id required: true type: string - description: 更新信息 in: body name: request required: true schema: $ref: '#/definitions/model.UpdateModelRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 更新模型 tags: - 模型管理 /model/add: post: consumes: - application/json description: 添加新的AI模型配置 parameters: - description: 模型信息 in: body name: request required: true schema: $ref: '#/definitions/model.CreateModelRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 添加模型 tags: - 模型管理 /model/list: get: consumes: - application/json description: 获取所有已添加的AI模型列表 produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取模型列表 tags: - 模型管理 /model/test: post: consumes: - application/json description: 测试AI模型连接是否正常 parameters: - description: 模型测试请求 in: body name: request required: true schema: $ref: '#/definitions/model.TestModelRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 测试模型连接 tags: - 模型管理 /neo4j/check: post: consumes: - application/json description: 测试 Neo4j 数据库连接是否正常 parameters: - description: Neo4j连接信息 in: body name: request required: true schema: $ref: '#/definitions/model.Neo4jCheckRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 检查 Neo4j 连接 tags: - Neo4j /neo4j/graphs: post: consumes: - application/json description: 获取 Neo4j 中的图谱概览数据 parameters: - description: 图谱查询请求 in: body name: request required: true schema: $ref: '#/definitions/model.Neo4jGraphRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取图谱概览 tags: - Neo4j /neo4j/nodes: post: consumes: - application/json description: 获取 Neo4j 中的节点详情 parameters: - description: 节点查询请求 in: body name: request required: true schema: $ref: '#/definitions/model.Neo4jNodeRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取节点列表 tags: - Neo4j /neo4j/relationships: post: consumes: - application/json description: 获取 Neo4j 中的关系详情 parameters: - description: 关系查询请求 in: body name: request required: true schema: $ref: '#/definitions/model.Neo4jRelRequest' produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取关系列表 tags: - Neo4j /sub-table/{id}: delete: consumes: - application/json description: 删除指定的子表映射 parameters: - description: 子表ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: 删除子表映射 tags: - 子表管理 get: consumes: - application/json description: 根据ID获取子表映射详情 parameters: - description: 子表ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/model.SubTableInfo' "404": description: Not Found schema: additionalProperties: type: string type: object summary: 获取子表详情 tags: - 子表管理 put: consumes: - application/json description: 更新子表映射信息 parameters: - description: 子表ID in: path name: id required: true type: string - description: 更新信息 in: body name: request required: true schema: $ref: '#/definitions/model.UpdateSubTableRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/model.SubTableInfo' "400": description: Bad Request schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: 更新子表映射 tags: - 子表管理 /sub-table/add: post: consumes: - application/json description: 添加数据库的子表映射关系 parameters: - description: 子表信息 in: body name: request required: true schema: $ref: '#/definitions/model.CreateSubTableRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/model.SubTableInfo' "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 创建子表映射 tags: - 子表管理 /sub-table/database/{database_id}: get: consumes: - application/json description: 获取指定数据库的所有子表映射列表 parameters: - description: 数据库ID in: path name: database_id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取数据库下所有子表 tags: - 子表管理 /sub-table/ddl/{database_id}: get: consumes: - application/json description: 获取数据库下所有表的DDL语句 parameters: - description: 数据库ID in: path name: database_id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取表结构DDL tags: - 子表管理 /sub-table/mapping/{database_id}: get: consumes: - application/json description: 从文件中读取子表映射关系 parameters: - description: 数据库ID in: path name: database_id required: true type: string produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 从文件获取映射 tags: - 子表管理 /system/info: get: consumes: - application/json description: 获取服务器系统信息(CPU、内存等) produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/model.SystemInfo' "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: 获取系统信息 tags: - 系统 swagger: "2.0"