{"openapi": "3.0.0", "info": {"title": "ERPTurbo_Poster API", "version": "1.0.0", "description": "海报和PDF生成服务API文档"}, "servers": [{"url": "http://localhost:3000", "description": "开发服务器"}], "paths": {"/status": {"get": {"summary": "健康检查", "description": "检查服务是否正常运行", "tags": ["Health"], "responses": {"200": {"description": "服务正常运行", "content": {"application/json": {"schema": {"type": "object", "properties": {"success": {"type": "boolean", "example": true, "description": "请求是否成功"}, "data": {"type": "object", "example": {}, "description": "响应数据"}, "message": {"type": "string", "example": "Service is running", "description": "响应消息"}, "code": {"type": "number", "example": 200, "description": "响应代码"}}}}}}, "500": {"description": "服务异常"}}}}, "/api/v1/poster": {"post": {"summary": "生成海报", "description": "从网页URL或HTML内容生成海报图像", "tags": ["Poster"], "security": [{"ApiKeyAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"webpage": {"type": "string", "description": "要生成海报的网页URL", "example": "https://example.com"}, "html": {"type": "string", "description": "要生成海报的HTML内容(可选,优先级高于webpage)", "example": "

Hello World

"}, "device": {"type": "number", "description": "设备缩放因子", "default": 1, "example": 1}, "width": {"type": "number", "description": "海报宽度", "default": 1920, "example": 1920}, "height": {"type": "number", "description": "海报高度", "default": 1080, "example": 1080}, "type": {"type": "string", "description": "输出图像类型", "default": "png", "example": "png"}, "encoding": {"type": "string", "description": "编码类型", "default": "binary", "example": "binary"}}}}}}, "responses": {"200": {"description": "成功生成海报", "content": {"application/json": {"schema": {"type": "object", "properties": {"success": {"type": "boolean", "example": true, "description": "请求是否成功"}, "data": {"type": "object", "properties": {"name": {"type": "string", "example": "poster_abc123def456.png", "description": "生成的海报文件名"}, "path": {"type": "string", "example": "http://example.com/uploads/posters/2024/11/14/poster_abc123def456.png", "description": "生成的海报文件访问路径"}}}, "message": {"type": "string", "example": "Poster generated successfully", "description": "响应消息"}, "code": {"type": "number", "example": 200, "description": "响应代码"}}}}}}, "400": {"description": "请求参数错误", "content": {"application/json": {"schema": {"type": "object", "properties": {"success": {"type": "boolean", "example": false, "description": "请求是否成功"}, "data": {"type": "object", "example": null, "description": "响应数据"}, "message": {"type": "string", "example": "Missing required parameter: webpage or html", "description": "错误消息"}, "code": {"type": "number", "example": 3001, "description": "错误代码"}}}}}}, "401": {"description": "未授权访问"}, "500": {"description": "服务器内部错误"}}}}, "/api/v1/pdf": {"post": {"summary": "生成PDF", "description": "从网页URL或HTML内容生成PDF文档", "tags": ["PDF"], "security": [{"ApiKeyAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"webpage": {"type": "string", "description": "要生成PDF的网页URL", "example": "https://example.com"}, "html": {"type": "string", "description": "要生成PDF的HTML内容(可选,优先级高于webpage)", "example": "

Hello World

"}, "device": {"type": "number", "description": "设备缩放因子", "default": 1, "example": 1}, "width": {"type": "number", "description": "PDF宽度", "default": 1920, "example": 1920}, "height": {"type": "number", "description": "PDF高度", "default": 1080, "example": 1080}}}}}}, "responses": {"200": {"description": "成功生成PDF", "content": {"application/json": {"schema": {"type": "object", "properties": {"success": {"type": "boolean", "example": true, "description": "请求是否成功"}, "data": {"type": "object", "properties": {"name": {"type": "string", "example": "pdf_abc123def456.pdf", "description": "生成的PDF文件名"}, "path": {"type": "string", "example": "http://example.com/uploads/pdfs/2024/11/14/pdf_abc123def456.pdf", "description": "生成的PDF文件访问路径"}}}, "message": {"type": "string", "example": "PDF generated successfully", "description": "响应消息"}, "code": {"type": "number", "example": 200, "description": "响应代码"}}}}}}, "400": {"description": "请求参数错误", "content": {"application/json": {"schema": {"type": "object", "properties": {"success": {"type": "boolean", "example": false, "description": "请求是否成功"}, "data": {"type": "object", "example": null, "description": "响应数据"}, "message": {"type": "string", "example": "Missing required parameter: webpage or html", "description": "错误消息"}, "code": {"type": "number", "example": 3001, "description": "错误代码"}}}}}}, "401": {"description": "未授权访问"}, "500": {"description": "服务器内部错误"}}}}}, "components": {}, "tags": []}