report-api.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. openapi: 3.0.3
  2. info:
  3. title: Financial Report Generation - Report API
  4. version: 1.0.0
  5. description: 报告管理API
  6. servers:
  7. - url: http://localhost:8080/api/v1
  8. description: 本地开发环境
  9. - url: https://api.finrep.example.com/api/v1
  10. description: 生产环境
  11. tags:
  12. - name: Report
  13. description: 报告管理
  14. paths:
  15. /tasks/{taskId}/reports:
  16. get:
  17. summary: 查询任务报告列表
  18. tags:
  19. - Report
  20. parameters:
  21. - name: taskId
  22. in: path
  23. required: true
  24. schema:
  25. type: string
  26. - name: tenantId
  27. in: header
  28. required: true
  29. schema:
  30. type: string
  31. responses:
  32. '200':
  33. description: 成功
  34. content:
  35. application/json:
  36. schema:
  37. type: array
  38. items:
  39. $ref: '#/components/schemas/ReportResponse'
  40. post:
  41. summary: 创建报告
  42. tags:
  43. - Report
  44. parameters:
  45. - name: taskId
  46. in: path
  47. required: true
  48. schema:
  49. type: string
  50. - name: tenantId
  51. in: header
  52. required: true
  53. schema:
  54. type: string
  55. requestBody:
  56. required: true
  57. content:
  58. application/json:
  59. schema:
  60. $ref: '#/components/schemas/ReportRequest'
  61. responses:
  62. '200':
  63. description: 成功
  64. content:
  65. application/json:
  66. schema:
  67. $ref: '#/components/schemas/ReportResponse'
  68. /reports/{reportId}:
  69. get:
  70. summary: 查询报告详情
  71. tags:
  72. - Report
  73. parameters:
  74. - name: reportId
  75. in: path
  76. required: true
  77. schema:
  78. type: string
  79. - name: tenantId
  80. in: header
  81. required: true
  82. schema:
  83. type: string
  84. responses:
  85. '200':
  86. description: 成功
  87. content:
  88. application/json:
  89. schema:
  90. $ref: '#/components/schemas/ReportResponse'
  91. put:
  92. summary: 更新报告
  93. tags:
  94. - Report
  95. parameters:
  96. - name: reportId
  97. in: path
  98. required: true
  99. schema:
  100. type: string
  101. - name: tenantId
  102. in: header
  103. required: true
  104. schema:
  105. type: string
  106. requestBody:
  107. required: true
  108. content:
  109. application/json:
  110. schema:
  111. $ref: '#/components/schemas/ReportRequest'
  112. responses:
  113. '200':
  114. description: 成功
  115. delete:
  116. summary: 删除报告
  117. tags:
  118. - Report
  119. parameters:
  120. - name: reportId
  121. in: path
  122. required: true
  123. schema:
  124. type: string
  125. - name: tenantId
  126. in: header
  127. required: true
  128. schema:
  129. type: string
  130. responses:
  131. '200':
  132. description: 成功
  133. /reports/{reportId}/export:
  134. post:
  135. summary: 导出报告
  136. tags:
  137. - Report
  138. parameters:
  139. - name: reportId
  140. in: path
  141. required: true
  142. schema:
  143. type: string
  144. - name: tenantId
  145. in: header
  146. required: true
  147. schema:
  148. type: string
  149. - name: format
  150. in: query
  151. required: true
  152. schema:
  153. type: string
  154. enum: [PDF, WORD, HTML]
  155. responses:
  156. '200':
  157. description: 成功
  158. content:
  159. application/octet-stream:
  160. schema:
  161. type: string
  162. format: binary
  163. headers:
  164. Content-Disposition:
  165. schema:
  166. type: string
  167. description: 文件下载响应头
  168. components:
  169. schemas:
  170. ReportRequest:
  171. type: object
  172. required:
  173. - title
  174. - format
  175. properties:
  176. title:
  177. type: string
  178. description: 报告标题
  179. maxLength: 255
  180. content:
  181. type: string
  182. description: 报告内容
  183. format:
  184. type: string
  185. description: 报告格式
  186. enum: [PDF, WORD, HTML, MARKDOWN, JSON]
  187. outlineId:
  188. type: string
  189. description: 关联大纲ID
  190. metadata:
  191. type: object
  192. description: 元数据
  193. ReportResponse:
  194. type: object
  195. properties:
  196. reportId:
  197. type: string
  198. description: 报告ID
  199. taskId:
  200. type: string
  201. description: 任务ID
  202. tenantId:
  203. type: string
  204. description: 租户ID
  205. title:
  206. type: string
  207. description: 报告标题
  208. content:
  209. type: string
  210. description: 报告内容
  211. format:
  212. type: string
  213. description: 报告格式
  214. status:
  215. type: string
  216. description: 报告状态
  217. enum: [DRAFT, GENERATING, COMPLETED, FAILED]
  218. outlineId:
  219. type: string
  220. description: 关联大纲ID
  221. outlineVersion:
  222. type: integer
  223. description: 大纲版本
  224. fileUrl:
  225. type: string
  226. description: 文件URL
  227. fileSize:
  228. type: integer
  229. description: 文件大小
  230. metadata:
  231. type: object
  232. description: 元数据
  233. reviewerId:
  234. type: string
  235. description: 审核人ID
  236. reviewerName:
  237. type: string
  238. description: 审核人名称
  239. reviewTime:
  240. type: string
  241. format: date-time
  242. description: 审核时间
  243. createTime:
  244. type: string
  245. format: date-time
  246. description: 创建时间
  247. updateTime:
  248. type: string
  249. format: date-time
  250. description: 更新时间