Json-Python-Server/openapi.json
2026-01-29 18:18:32 +08:00

552 lines
15 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"openapi": "3.1.0",
"info": {
"title": "时间序列数据分析系统",
"description": "支持多格式数据上传、AI增强分析、多语言报告生成",
"version": "2.0.0"
},
"paths": {
"/api/upload": {
"post": {
"tags": [
"upload"
],
"summary": "上传CSV或图片文件",
"description": "上传数据文件CSV 或图片)\n\n- **file**: CSV 或图片文件 (PNG, JPG, BMP, TIFF)\n- **task_description**: 分析任务描述",
"operationId": "upload_file_api_upload_post",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/Body_upload_file_api_upload_post"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/available_methods": {
"get": {
"tags": [
"analysis"
],
"summary": "获取可用的分析方法",
"description": "获取所有可用的分析方法",
"operationId": "get_available_methods_api_available_methods_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"type": "object",
"title": "Response Get Available Methods Api Available Methods Get"
}
}
}
}
}
}
},
"/api/analyze": {
"post": {
"tags": [
"analysis"
],
"summary": "执行完整分析",
"description": "执行完整的时间序列分析\n\n流程:\n1. 加载并预处理数据\n2. 执行15种分析方法\n3. 调用AI API 进行深度分析\n4. 生成PDF/PPT/HTML报告",
"operationId": "analyze_data_api_analyze_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnalysisRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"type": "object",
"title": "Response Analyze Data Api Analyze Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v2/available_methods": {
"get": {
"tags": [
"analysis-v2"
],
"summary": "获取可用的分析方法v2",
"description": "v2 版本:返回与 v1 相同的可用分析方法列表。",
"operationId": "get_available_methods_v2_api_v2_available_methods_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"type": "object",
"title": "Response Get Available Methods V2 Api V2 Available Methods Get"
}
}
}
}
}
}
},
"/api/v2/analyze": {
"post": {
"tags": [
"analysis-v2"
],
"summary": "执行完整分析v2从 OSS URL 读取 CSV",
"description": "Analyze CSV from an OSS/URL, returning the same structure as v1.",
"operationId": "analyze_data_v2_api_v2_analyze_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnalysisV2Request"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"type": "object",
"title": "Response Analyze Data V2 Api V2 Analyze Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/image/{filename}": {
"get": {
"tags": [
"files"
],
"summary": "获取图片文件",
"description": "获取可视化图片文件",
"operationId": "serve_image_api_image__filename__get",
"parameters": [
{
"name": "filename",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Filename"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/download/{filename}": {
"get": {
"tags": [
"files"
],
"summary": "下载文件",
"description": "下载报告或其他文件",
"operationId": "download_file_api_download__filename__get",
"parameters": [
{
"name": "filename",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Filename"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/list_uploads": {
"get": {
"tags": [
"files"
],
"summary": "列出上传的文件",
"description": "列出 uploads 目录中的文件",
"operationId": "list_uploads_api_list_uploads_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/": {
"get": {
"summary": "Root",
"description": "根路径",
"operationId": "root__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/health": {
"get": {
"summary": "Health",
"description": "健康检查",
"operationId": "health_health_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/api/config": {
"get": {
"summary": "Get Config",
"description": "获取应用配置",
"operationId": "get_config_api_config_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
}
},
"components": {
"schemas": {
"AnalysisRequest": {
"properties": {
"filename": {
"type": "string",
"title": "Filename"
},
"file_type": {
"type": "string",
"title": "File Type",
"default": "csv"
},
"task_description": {
"type": "string",
"title": "Task Description",
"default": "时间序列数据分析"
},
"data_background": {
"additionalProperties": true,
"type": "object",
"title": "Data Background",
"default": {}
},
"original_image": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Original Image"
},
"language": {
"type": "string",
"title": "Language",
"default": "zh"
},
"generate_plots": {
"type": "boolean",
"title": "Generate Plots",
"default": false
}
},
"type": "object",
"required": [
"filename"
],
"title": "AnalysisRequest",
"description": "分析请求模型"
},
"AnalysisV2Request": {
"properties": {
"oss_url": {
"type": "string",
"title": "Oss Url"
},
"task_description": {
"type": "string",
"title": "Task Description",
"default": "时间序列数据分析"
},
"data_background": {
"additionalProperties": true,
"type": "object",
"title": "Data Background",
"default": {}
},
"language": {
"type": "string",
"title": "Language",
"default": "zh"
},
"generate_plots": {
"type": "boolean",
"title": "Generate Plots",
"default": false
},
"source_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Name"
}
},
"type": "object",
"required": [
"oss_url"
],
"title": "AnalysisV2Request",
"description": "v2 分析请求模型(输入为 OSS/URL"
},
"Body_upload_file_api_upload_post": {
"properties": {
"file": {
"type": "string",
"format": "binary",
"title": "File"
},
"task_description": {
"type": "string",
"title": "Task Description",
"default": "时间序列数据分析"
}
},
"type": "object",
"required": [
"file"
],
"title": "Body_upload_file_api_upload_post"
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"UploadResponse": {
"properties": {
"success": {
"type": "boolean",
"title": "Success"
},
"filename": {
"type": "string",
"title": "Filename"
},
"file_type": {
"type": "string",
"title": "File Type"
},
"original_filename": {
"type": "string",
"title": "Original Filename"
},
"task_description": {
"type": "string",
"title": "Task Description"
},
"message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Message"
}
},
"type": "object",
"required": [
"success",
"filename",
"file_type",
"original_filename",
"task_description"
],
"title": "UploadResponse",
"description": "上传响应模型"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
}
}