documents.yaml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. Documents:
  2. get:
  3. operationId: listDocuments
  4. summary: 分页查询主案和子方案
  5. parameters:
  6. - $ref: '../components/parameters.yaml#/XRequestId'
  7. - {name: documentType, in: query, schema: {type: string, default: MAIN}}
  8. - {name: categoryId, in: query, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  9. - name: includeDescendants
  10. in: query
  11. description: 与categoryId同时使用时,是否包含全部有效后代分类;默认false。
  12. schema: {type: boolean, default: false}
  13. - {name: keyword, in: query, schema: {type: string}}
  14. - {name: securityLevel, in: query, schema: {$ref: '../components/schemas.yaml#/SecurityLevel'}}
  15. - {name: visibilityType, in: query, schema: {$ref: '../components/schemas.yaml#/VisibilityType'}}
  16. - {name: status, in: query, schema: {$ref: '../components/schemas.yaml#/DocumentStatus'}}
  17. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  18. - $ref: '../components/parameters.yaml#/UpdatedTo'
  19. - name: sortBy
  20. in: query
  21. schema:
  22. type: string
  23. enum: [documentName, createdAt, updatedAt, viewCount, downloadCount]
  24. default: updatedAt
  25. - {name: sortDirection, in: query, schema: {type: string, enum: [asc, desc], default: desc}}
  26. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  27. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  28. responses:
  29. '200': {description: 方案分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPageResponse'}}}}
  30. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  31. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  32. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  33. '404': {$ref: '../components/responses.yaml#/NotFound'}
  34. '500': {$ref: '../components/responses.yaml#/InternalError'}
  35. post:
  36. operationId: createDocument
  37. summary: 上传主案或子方案
  38. requestBody:
  39. required: true
  40. content:
  41. multipart/form-data:
  42. schema:
  43. type: object
  44. additionalProperties: false
  45. required: [file, metadata]
  46. properties:
  47. file: {type: string, format: binary}
  48. metadata:
  49. type: string
  50. description: DocumentCreateMetadata的JSON字符串。
  51. responses:
  52. '201': {description: 上传成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  53. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  54. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  55. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  56. '404': {$ref: '../components/responses.yaml#/NotFound'}
  57. '409': {$ref: '../components/responses.yaml#/Conflict'}
  58. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  59. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  60. '500': {$ref: '../components/responses.yaml#/InternalError'}
  61. Document:
  62. parameters:
  63. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  64. get:
  65. operationId: getDocument
  66. summary: 查询主案或子方案详情
  67. responses:
  68. '200': {description: 方案详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  69. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  70. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  71. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  72. '404': {$ref: '../components/responses.yaml#/NotFound'}
  73. '500': {$ref: '../components/responses.yaml#/InternalError'}
  74. put:
  75. operationId: updateDocument
  76. summary: 编辑方案文档元数据
  77. requestBody:
  78. required: true
  79. content:
  80. application/json:
  81. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentRequest'}
  82. responses:
  83. '200': {description: 编辑成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  84. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  85. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  86. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  87. '404': {$ref: '../components/responses.yaml#/NotFound'}
  88. '409': {$ref: '../components/responses.yaml#/Conflict'}
  89. '500': {$ref: '../components/responses.yaml#/InternalError'}
  90. delete:
  91. operationId: deleteDocument
  92. summary: 逻辑删除方案文档
  93. parameters:
  94. - {name: rowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  95. responses:
  96. '200': {description: 删除成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DeleteDocumentResponse'}}}}
  97. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  98. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  99. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  100. '404': {$ref: '../components/responses.yaml#/NotFound'}
  101. '409': {$ref: '../components/responses.yaml#/Conflict'}
  102. '500': {$ref: '../components/responses.yaml#/InternalError'}
  103. SubPlans:
  104. parameters:
  105. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  106. get:
  107. operationId: listMainPlanSubPlans
  108. summary: 查询主案的直接子方案
  109. parameters:
  110. - {name: keyword, in: query, schema: {type: string}}
  111. - {name: status, in: query, schema: {$ref: '../components/schemas.yaml#/DocumentStatus'}}
  112. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  113. - $ref: '../components/parameters.yaml#/UpdatedTo'
  114. - name: sortBy
  115. in: query
  116. schema: {type: string, enum: [documentName, createdAt, updatedAt, viewCount, downloadCount], default: updatedAt}
  117. - {name: sortDirection, in: query, schema: {type: string, enum: [asc, desc], default: desc}}
  118. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  119. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  120. responses:
  121. '200': {description: 子方案分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPageResponse'}}}}
  122. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  123. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  124. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  125. '404': {$ref: '../components/responses.yaml#/NotFound'}
  126. '500': {$ref: '../components/responses.yaml#/InternalError'}
  127. Attachments:
  128. get:
  129. operationId: listAttachments
  130. summary: ADMIN分页查询独立共享附件库
  131. parameters:
  132. - $ref: '../components/parameters.yaml#/XRequestId'
  133. - {name: keyword, in: query, schema: {type: string}}
  134. - {name: attachmentType, in: query, schema: {$ref: '../components/schemas.yaml#/AttachmentType'}}
  135. - {name: fileExtension, in: query, schema: {type: string}}
  136. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  137. - $ref: '../components/parameters.yaml#/UpdatedTo'
  138. - name: sortBy
  139. in: query
  140. schema: {type: string, enum: [documentName, createdAt, updatedAt, viewCount, downloadCount], default: updatedAt}
  141. - {name: sortDirection, in: query, schema: {type: string, enum: [asc, desc], default: desc}}
  142. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  143. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  144. responses:
  145. '200': {description: 附件分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPageResponse'}}}}
  146. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  147. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  148. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  149. '404': {$ref: '../components/responses.yaml#/NotFound'}
  150. '500': {$ref: '../components/responses.yaml#/InternalError'}
  151. post:
  152. operationId: createAttachment
  153. summary: 上传共享附件
  154. requestBody:
  155. required: true
  156. content:
  157. multipart/form-data:
  158. schema:
  159. type: object
  160. additionalProperties: false
  161. required: [file, metadata]
  162. properties:
  163. file: {type: string, format: binary}
  164. metadata:
  165. type: string
  166. description: AttachmentCreateMetadata的JSON字符串。
  167. responses:
  168. '201': {description: 上传成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  169. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  170. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  171. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  172. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  173. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  174. '500': {$ref: '../components/responses.yaml#/InternalError'}
  175. Attachment:
  176. parameters:
  177. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  178. get:
  179. operationId: getAttachment
  180. summary: 查询共享附件详情
  181. responses:
  182. '200': {description: 附件详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  183. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  184. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  185. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  186. '404': {$ref: '../components/responses.yaml#/NotFound'}
  187. '500': {$ref: '../components/responses.yaml#/InternalError'}
  188. put:
  189. operationId: updateAttachment
  190. summary: 编辑共享附件元数据
  191. requestBody:
  192. required: true
  193. content:
  194. application/json:
  195. schema: {$ref: '../components/schemas.yaml#/UpdateAttachmentRequest'}
  196. responses:
  197. '200': {description: 编辑成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  198. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  199. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  200. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  201. '404': {$ref: '../components/responses.yaml#/NotFound'}
  202. '409': {$ref: '../components/responses.yaml#/Conflict'}
  203. '500': {$ref: '../components/responses.yaml#/InternalError'}
  204. delete:
  205. operationId: deleteAttachment
  206. summary: 逻辑删除共享附件
  207. parameters:
  208. - {name: rowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  209. responses:
  210. '200': {description: 删除成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DeleteDocumentResponse'}}}}
  211. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  212. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  213. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  214. '404': {$ref: '../components/responses.yaml#/NotFound'}
  215. '409': {$ref: '../components/responses.yaml#/Conflict'}
  216. '500': {$ref: '../components/responses.yaml#/InternalError'}
  217. DocumentBatchImport:
  218. post:
  219. operationId: batchImportDocuments
  220. summary: 批量导入主案和子方案
  221. requestBody:
  222. required: true
  223. content:
  224. multipart/form-data:
  225. schema:
  226. $ref: '../components/schemas.yaml#/BatchImportMultipart'
  227. responses:
  228. '200': {description: 逐文件导入结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BatchImportResponse'}}}}
  229. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  230. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  231. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  232. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  233. '500': {$ref: '../components/responses.yaml#/InternalError'}
  234. AttachmentBatchImport:
  235. post:
  236. operationId: batchImportAttachments
  237. summary: 批量导入共享附件
  238. requestBody:
  239. required: true
  240. content:
  241. multipart/form-data:
  242. schema:
  243. $ref: '../components/schemas.yaml#/BatchImportMultipart'
  244. responses:
  245. '200': {description: 逐文件导入结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BatchImportResponse'}}}}
  246. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  247. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  248. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  249. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  250. '500': {$ref: '../components/responses.yaml#/InternalError'}
  251. DocumentPreview:
  252. parameters:
  253. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  254. get:
  255. operationId: previewDocument
  256. summary: PDF直接预览;DOC、DOCX由LibreOffice离线转换为PDF后预览
  257. responses:
  258. '200':
  259. description: PDF文件流(PDF原文件或DOC/DOCX转换后的PDF)
  260. headers:
  261. X-Request-Id: {schema: {type: string, format: uuid}}
  262. content:
  263. application/pdf: {schema: {type: string, format: binary}}
  264. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  265. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  266. '404': {$ref: '../components/responses.yaml#/NotFound'}
  267. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  268. '502': {$ref: '../components/responses.yaml#/PreviewConversionFailed'}
  269. '503': {$ref: '../components/responses.yaml#/PreviewConverterUnavailable'}
  270. '504': {$ref: '../components/responses.yaml#/PreviewConversionTimeout'}
  271. '500': {$ref: '../components/responses.yaml#/InternalError'}
  272. DocumentDownload:
  273. parameters:
  274. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  275. get:
  276. operationId: downloadDocument
  277. summary: 下载原始文档
  278. responses:
  279. '200':
  280. description: 原始文件流
  281. headers:
  282. X-Request-Id: {schema: {type: string, format: uuid}}
  283. content:
  284. application/octet-stream: {schema: {type: string, format: binary}}
  285. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  286. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  287. '404': {$ref: '../components/responses.yaml#/NotFound'}
  288. '500': {$ref: '../components/responses.yaml#/InternalError'}
  289. AttachmentMainPlans:
  290. parameters:
  291. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  292. get:
  293. operationId: listAttachmentMainPlans
  294. summary: 查询共享附件挂载的可见主案
  295. responses:
  296. '200': {description: 主案简要集合, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/MainPlanBriefCollectionResponse'}}}}
  297. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  298. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  299. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  300. '404': {$ref: '../components/responses.yaml#/NotFound'}
  301. '500': {$ref: '../components/responses.yaml#/InternalError'}
  302. MainPlanAttachments:
  303. parameters:
  304. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  305. get:
  306. operationId: listMainPlanAttachments
  307. summary: 查询主案已挂载共享附件
  308. parameters:
  309. - {name: keyword, in: query, schema: {type: string}}
  310. - {name: attachmentType, in: query, schema: {$ref: '../components/schemas.yaml#/AttachmentType'}}
  311. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  312. - $ref: '../components/parameters.yaml#/UpdatedTo'
  313. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  314. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  315. responses:
  316. '200': {description: 挂载附件分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/AttachmentBindingPageResponse'}}}}
  317. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  318. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  319. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  320. '404': {$ref: '../components/responses.yaml#/NotFound'}
  321. '500': {$ref: '../components/responses.yaml#/InternalError'}
  322. MainPlanAttachmentBinding:
  323. parameters:
  324. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  325. post:
  326. operationId: bindMainPlanAttachments
  327. summary: 批量挂载共享附件到主案
  328. requestBody:
  329. required: true
  330. content:
  331. application/json:
  332. schema: {$ref: '../components/schemas.yaml#/BindAttachmentsRequest'}
  333. responses:
  334. '200': {description: 挂载结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BindAttachmentsResponse'}}}}
  335. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  336. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  337. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  338. '404': {$ref: '../components/responses.yaml#/NotFound'}
  339. '409': {$ref: '../components/responses.yaml#/Conflict'}
  340. '500': {$ref: '../components/responses.yaml#/InternalError'}
  341. MainPlanAttachment:
  342. parameters:
  343. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  344. - {name: attachmentId, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  345. delete:
  346. operationId: unbindMainPlanAttachment
  347. summary: 解除主案和共享附件的挂载
  348. parameters:
  349. - {name: mainPlanRowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  350. responses:
  351. '200': {description: 解除挂载结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/UnbindAttachmentResponse'}}}}
  352. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  353. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  354. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  355. '404': {$ref: '../components/responses.yaml#/NotFound'}
  356. '409': {$ref: '../components/responses.yaml#/Conflict'}
  357. '500': {$ref: '../components/responses.yaml#/InternalError'}
  358. DocumentPermissions:
  359. parameters:
  360. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  361. get:
  362. operationId: getDocumentPermissions
  363. summary: 查询主案权限或子方案继承权限
  364. responses:
  365. '200': {description: 权限详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/PermissionDetailResponse'}}}}
  366. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  367. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  368. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  369. '404': {$ref: '../components/responses.yaml#/NotFound'}
  370. '409': {$ref: '../components/responses.yaml#/Conflict'}
  371. '500': {$ref: '../components/responses.yaml#/InternalError'}
  372. put:
  373. operationId: saveDocumentPermissions
  374. summary: 全量保存主案权限
  375. requestBody:
  376. required: true
  377. content:
  378. application/json:
  379. schema: {$ref: '../components/schemas.yaml#/SavePermissionsRequest'}
  380. responses:
  381. '200': {description: 保存后的权限详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/PermissionDetailResponse'}}}}
  382. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  383. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  384. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  385. '404': {$ref: '../components/responses.yaml#/NotFound'}
  386. '409': {$ref: '../components/responses.yaml#/Conflict'}
  387. '500': {$ref: '../components/responses.yaml#/InternalError'}