Archived
chore: update OpenAPI spec with new service title and server URL
This commit is contained in:
+6
-47
@@ -1,15 +1,11 @@
|
|||||||
openapi: "3.1.0"
|
openapi: "3.1.0"
|
||||||
info:
|
info:
|
||||||
title: GMP Mock Service API
|
title: Service API
|
||||||
description: |
|
|
||||||
Mock 服务,提供基于 Word 模板的文档导出功能。
|
|
||||||
模板使用 poi-tl 的 `{{variable}}` 语法标记占位符,
|
|
||||||
业务数据通过 `businessData` 传入。
|
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
contact:
|
contact:
|
||||||
name: closein
|
name: closein
|
||||||
servers:
|
servers:
|
||||||
- url: http://localhost:6666
|
- url: http://193.112.146.124:6666
|
||||||
description: 本地开发服务器
|
description: 本地开发服务器
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
@@ -17,9 +13,7 @@ paths:
|
|||||||
post:
|
post:
|
||||||
summary: 导出 Word 文档
|
summary: 导出 Word 文档
|
||||||
description: |
|
description: |
|
||||||
根据模板 ID 选择模板,填充业务数据后流式返回 `.docx` 文件。
|
请求成功时返回文件流,失败时返回 JSON 错误体。
|
||||||
|
|
||||||
请求成功时直接流式下载文件,失败时返回 JSON 错误体。
|
|
||||||
operationId: exportDocx
|
operationId: exportDocx
|
||||||
tags:
|
tags:
|
||||||
- Docx Export
|
- Docx Export
|
||||||
@@ -31,10 +25,10 @@ paths:
|
|||||||
$ref: '#/components/schemas/DocxExportRequest'
|
$ref: '#/components/schemas/DocxExportRequest'
|
||||||
example:
|
example:
|
||||||
exportId: "annualReport"
|
exportId: "annualReport"
|
||||||
businessData: {}
|
businessData: { startYear: 2023, endYear: 2024 }
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: 成功 — 流式下载 `.docx` 文件
|
description: 成功 — 流式下载文件
|
||||||
content:
|
content:
|
||||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document:
|
application/vnd.openxmlformats-officedocument.wordprocessingml.document:
|
||||||
schema:
|
schema:
|
||||||
@@ -84,7 +78,7 @@ components:
|
|||||||
description: |
|
description: |
|
||||||
业务数据键值对,用于填充模板中的变量。
|
业务数据键值对,用于填充模板中的变量。
|
||||||
当前模板自行定义默认值,后续可改为从此处读取。
|
当前模板自行定义默认值,后续可改为从此处读取。
|
||||||
example: {}
|
example: { }
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|
||||||
ApiError:
|
ApiError:
|
||||||
@@ -101,38 +95,3 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
description: 错误描述
|
description: 错误描述
|
||||||
example: "exportId 不能为空"
|
example: "exportId 不能为空"
|
||||||
|
|
||||||
# --- 模板定义(非 OpenAPI 标准,用于文档参考) ---
|
|
||||||
|
|
||||||
Template:
|
|
||||||
type: object
|
|
||||||
description: 可用模板
|
|
||||||
properties:
|
|
||||||
exportId:
|
|
||||||
type: string
|
|
||||||
description: 模板标识
|
|
||||||
example: "annualReport"
|
|
||||||
fileName:
|
|
||||||
type: string
|
|
||||||
description: 生成的文件名
|
|
||||||
example: "annualReport.docx"
|
|
||||||
variables:
|
|
||||||
type: array
|
|
||||||
description: 模板中可用的占位符变量
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
example:
|
|
||||||
- "{{title}}"
|
|
||||||
- "{{companyName}}"
|
|
||||||
- "{{reportPeriod}}"
|
|
||||||
- "{{generatedDate}}"
|
|
||||||
|
|
||||||
x-templates:
|
|
||||||
- exportId: "annualReport"
|
|
||||||
fileName: "annualReport.docx"
|
|
||||||
description: 年度工作报告模板,包含标题、公司信息、表格(3 行数据)
|
|
||||||
variables:
|
|
||||||
- title
|
|
||||||
- companyName
|
|
||||||
- reportPeriod
|
|
||||||
- generatedDate
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user