documents.yaml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  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. parameters:
  78. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  79. requestBody:
  80. required: true
  81. content:
  82. application/json:
  83. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentRequest'}
  84. responses:
  85. '200': {description: 编辑成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  86. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  87. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  88. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  89. '404': {$ref: '../components/responses.yaml#/NotFound'}
  90. '409': {$ref: '../components/responses.yaml#/Conflict'}
  91. '500': {$ref: '../components/responses.yaml#/InternalError'}
  92. delete:
  93. operationId: deleteDocument
  94. summary: 逻辑删除方案文档
  95. parameters:
  96. - {name: rowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  97. responses:
  98. '200': {description: 删除成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DeleteDocumentResponse'}}}}
  99. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  100. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  101. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  102. '404': {$ref: '../components/responses.yaml#/NotFound'}
  103. '409': {$ref: '../components/responses.yaml#/Conflict'}
  104. '500': {$ref: '../components/responses.yaml#/InternalError'}
  105. SubPlans:
  106. parameters:
  107. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  108. get:
  109. operationId: listMainPlanSubPlans
  110. summary: 查询主案的直接子方案
  111. parameters:
  112. - {name: keyword, in: query, schema: {type: string}}
  113. - {name: status, in: query, schema: {$ref: '../components/schemas.yaml#/DocumentStatus'}}
  114. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  115. - $ref: '../components/parameters.yaml#/UpdatedTo'
  116. - name: sortBy
  117. in: query
  118. schema: {type: string, enum: [documentName, createdAt, updatedAt, viewCount, downloadCount], default: updatedAt}
  119. - {name: sortDirection, in: query, schema: {type: string, enum: [asc, desc], default: desc}}
  120. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  121. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  122. responses:
  123. '200': {description: 子方案分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPageResponse'}}}}
  124. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  125. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  126. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  127. '404': {$ref: '../components/responses.yaml#/NotFound'}
  128. '500': {$ref: '../components/responses.yaml#/InternalError'}
  129. Attachments:
  130. get:
  131. operationId: listAttachments
  132. summary: 分页查询独立共享附件库(全量可见,普通用户allowedActions为空且不返回description/contentSnippet)
  133. description: 所有登录用户可访问,支撑全局检索按标题命中全部附件;附件内容访问由详情/预览/下载接口按挂载主案权限独立拦截。
  134. parameters:
  135. - $ref: '../components/parameters.yaml#/XRequestId'
  136. - {name: keyword, in: query, schema: {type: string}}
  137. - {name: attachmentType, in: query, schema: {$ref: '../components/schemas.yaml#/AttachmentType'}}
  138. - {name: fileExtension, in: query, schema: {type: string}}
  139. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  140. - $ref: '../components/parameters.yaml#/UpdatedTo'
  141. - name: sortBy
  142. in: query
  143. schema: {type: string, enum: [documentName, createdAt, updatedAt, viewCount, downloadCount], default: updatedAt}
  144. - {name: sortDirection, in: query, schema: {type: string, enum: [asc, desc], default: desc}}
  145. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  146. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  147. responses:
  148. '200': {description: 附件分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPageResponse'}}}}
  149. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  150. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  151. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  152. '404': {$ref: '../components/responses.yaml#/NotFound'}
  153. '500': {$ref: '../components/responses.yaml#/InternalError'}
  154. post:
  155. operationId: createAttachment
  156. summary: 上传共享附件
  157. requestBody:
  158. required: true
  159. content:
  160. multipart/form-data:
  161. schema:
  162. type: object
  163. additionalProperties: false
  164. required: [file, metadata]
  165. properties:
  166. file: {type: string, format: binary}
  167. metadata:
  168. type: string
  169. description: AttachmentCreateMetadata的JSON字符串。
  170. responses:
  171. '201': {description: 上传成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  172. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  173. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  174. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  175. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  176. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  177. '500': {$ref: '../components/responses.yaml#/InternalError'}
  178. Attachment:
  179. parameters:
  180. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  181. get:
  182. operationId: getAttachment
  183. summary: 查询共享附件详情
  184. responses:
  185. '200': {description: 附件详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  186. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  187. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  188. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  189. '404': {$ref: '../components/responses.yaml#/NotFound'}
  190. '500': {$ref: '../components/responses.yaml#/InternalError'}
  191. put:
  192. operationId: updateAttachment
  193. summary: 编辑共享附件元数据
  194. requestBody:
  195. required: true
  196. content:
  197. application/json:
  198. schema: {$ref: '../components/schemas.yaml#/UpdateAttachmentRequest'}
  199. responses:
  200. '200': {description: 编辑成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  201. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  202. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  203. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  204. '404': {$ref: '../components/responses.yaml#/NotFound'}
  205. '409': {$ref: '../components/responses.yaml#/Conflict'}
  206. '500': {$ref: '../components/responses.yaml#/InternalError'}
  207. delete:
  208. operationId: deleteAttachment
  209. summary: 逻辑删除共享附件
  210. parameters:
  211. - {name: rowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  212. responses:
  213. '200': {description: 删除成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DeleteDocumentResponse'}}}}
  214. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  215. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  216. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  217. '404': {$ref: '../components/responses.yaml#/NotFound'}
  218. '409': {$ref: '../components/responses.yaml#/Conflict'}
  219. '500': {$ref: '../components/responses.yaml#/InternalError'}
  220. DocumentBatchImport:
  221. post:
  222. operationId: batchImportDocuments
  223. summary: 批量导入主案和子方案
  224. requestBody:
  225. required: true
  226. content:
  227. multipart/form-data:
  228. schema:
  229. $ref: '../components/schemas.yaml#/BatchImportMultipart'
  230. responses:
  231. '200': {description: 逐文件导入结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BatchImportResponse'}}}}
  232. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  233. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  234. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  235. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  236. '500': {$ref: '../components/responses.yaml#/InternalError'}
  237. AttachmentBatchImport:
  238. post:
  239. operationId: batchImportAttachments
  240. summary: 批量导入共享附件
  241. requestBody:
  242. required: true
  243. content:
  244. multipart/form-data:
  245. schema:
  246. $ref: '../components/schemas.yaml#/BatchImportMultipart'
  247. responses:
  248. '200': {description: 逐文件导入结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BatchImportResponse'}}}}
  249. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  250. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  251. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  252. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  253. '500': {$ref: '../components/responses.yaml#/InternalError'}
  254. DocumentPreview:
  255. parameters:
  256. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  257. get:
  258. operationId: previewDocument
  259. summary: PDF直接预览;DOC、DOCX、WPS由LibreOffice离线转换为PDF后预览
  260. parameters:
  261. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  262. responses:
  263. '200':
  264. description: PDF文件流(PDF原文件或DOC/DOCX/WPS转换后的PDF)
  265. headers:
  266. X-Request-Id: {schema: {type: string, format: uuid}}
  267. content:
  268. application/pdf: {schema: {type: string, format: binary}}
  269. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  270. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  271. '404': {$ref: '../components/responses.yaml#/NotFound'}
  272. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  273. '502': {$ref: '../components/responses.yaml#/PreviewConversionFailed'}
  274. '503': {$ref: '../components/responses.yaml#/PreviewConverterUnavailable'}
  275. '504': {$ref: '../components/responses.yaml#/PreviewConversionTimeout'}
  276. '500': {$ref: '../components/responses.yaml#/InternalError'}
  277. DocumentDownload:
  278. parameters:
  279. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  280. get:
  281. operationId: downloadDocument
  282. summary: 下载原始文档
  283. parameters:
  284. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  285. responses:
  286. '200':
  287. description: 原始文件流
  288. headers:
  289. X-Request-Id: {schema: {type: string, format: uuid}}
  290. content:
  291. application/octet-stream: {schema: {type: string, format: binary}}
  292. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  293. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  294. '404': {$ref: '../components/responses.yaml#/NotFound'}
  295. '500': {$ref: '../components/responses.yaml#/InternalError'}
  296. AttachmentMainPlans:
  297. parameters:
  298. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  299. get:
  300. operationId: listAttachmentMainPlans
  301. summary: 查询共享附件挂载的可见主案
  302. responses:
  303. '200': {description: 主案简要集合, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/MainPlanBriefCollectionResponse'}}}}
  304. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  305. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  306. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  307. '404': {$ref: '../components/responses.yaml#/NotFound'}
  308. '500': {$ref: '../components/responses.yaml#/InternalError'}
  309. MainPlanAttachments:
  310. parameters:
  311. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  312. get:
  313. operationId: listMainPlanAttachments
  314. summary: 查询主案已挂载共享附件
  315. parameters:
  316. - {name: keyword, in: query, schema: {type: string}}
  317. - {name: attachmentType, in: query, schema: {$ref: '../components/schemas.yaml#/AttachmentType'}}
  318. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  319. - $ref: '../components/parameters.yaml#/UpdatedTo'
  320. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  321. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  322. responses:
  323. '200': {description: 挂载附件分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/AttachmentBindingPageResponse'}}}}
  324. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  325. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  326. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  327. '404': {$ref: '../components/responses.yaml#/NotFound'}
  328. '500': {$ref: '../components/responses.yaml#/InternalError'}
  329. MainPlanAttachmentBinding:
  330. parameters:
  331. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  332. post:
  333. operationId: bindMainPlanAttachments
  334. summary: 批量挂载共享附件到主案
  335. parameters:
  336. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  337. requestBody:
  338. required: true
  339. content:
  340. application/json:
  341. schema: {$ref: '../components/schemas.yaml#/BindAttachmentsRequest'}
  342. responses:
  343. '200': {description: 挂载结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BindAttachmentsResponse'}}}}
  344. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  345. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  346. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  347. '404': {$ref: '../components/responses.yaml#/NotFound'}
  348. '409': {$ref: '../components/responses.yaml#/Conflict'}
  349. '500': {$ref: '../components/responses.yaml#/InternalError'}
  350. MainPlanAttachmentsReorder:
  351. parameters:
  352. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  353. put:
  354. operationId: reorderMainPlanAttachments
  355. summary: 调整主案下挂载附件的显示顺序
  356. description: 顺序存于挂载关系,同一附件在不同主案中可各自独立排序。
  357. parameters:
  358. - $ref: '../components/parameters.yaml#/XRequestId'
  359. requestBody:
  360. required: true
  361. content:
  362. application/json:
  363. schema: {$ref: '../components/schemas.yaml#/ReorderAttachmentsRequest'}
  364. responses:
  365. '200': {description: 重排结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/ReorderAttachmentsResponse'}}}}
  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. MainPlanAttachment:
  373. parameters:
  374. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  375. - {name: attachmentId, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  376. delete:
  377. operationId: unbindMainPlanAttachment
  378. summary: 解除主案和共享附件的挂载
  379. parameters:
  380. - {name: mainPlanRowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  381. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  382. responses:
  383. '200': {description: 解除挂载结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/UnbindAttachmentResponse'}}}}
  384. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  385. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  386. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  387. '404': {$ref: '../components/responses.yaml#/NotFound'}
  388. '409': {$ref: '../components/responses.yaml#/Conflict'}
  389. '500': {$ref: '../components/responses.yaml#/InternalError'}
  390. DocumentsTags:
  391. get:
  392. operationId: listMainPlanTags
  393. summary: 聚合当前用户可见的主案标签
  394. description: 标签集合不随分类、关键词等筛选变化;按Unicode升序返回。
  395. parameters:
  396. - $ref: '../components/parameters.yaml#/XRequestId'
  397. responses:
  398. '200': {description: 标签集合, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentTagsResponse'}}}}
  399. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  400. '500': {$ref: '../components/responses.yaml#/InternalError'}
  401. DocumentsReorder:
  402. put:
  403. operationId: reorderDocuments
  404. summary: 管理员拖动重排主案/子方案
  405. description: 主案在全局范围排序,子方案在所属主案内排序,共享附件不支持;orderedIds为拖动后的目标顺序。
  406. parameters:
  407. - $ref: '../components/parameters.yaml#/XRequestId'
  408. requestBody:
  409. required: true
  410. content:
  411. application/json:
  412. schema: {$ref: '../components/schemas.yaml#/ReorderDocumentsRequest'}
  413. responses:
  414. '200': {description: 重排结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/ReorderDocumentsResponse'}}}}
  415. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  416. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  417. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  418. '404': {$ref: '../components/responses.yaml#/NotFound'}
  419. '409': {$ref: '../components/responses.yaml#/Conflict'}
  420. '500': {$ref: '../components/responses.yaml#/InternalError'}
  421. DocumentPassword:
  422. parameters:
  423. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  424. put:
  425. operationId: saveDocumentPassword
  426. summary: 设置/修改/清除主案密码锁(仅MAIN)
  427. description: |
  428. 未设密时设置:password+protectedActions必填;已设密时修改/清除:oldPassword必填且正确;
  429. password缺省或空表示清除。任何人(含ADMIN)修改/清除均需原密码;rowVersion乐观锁校验。
  430. requestBody:
  431. required: true
  432. content:
  433. application/json:
  434. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentPasswordRequest'}
  435. responses:
  436. '200': {description: 密码锁摘要, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPasswordResponse'}}}}
  437. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  438. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  439. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  440. '404': {$ref: '../components/responses.yaml#/NotFound'}
  441. '409': {$ref: '../components/responses.yaml#/Conflict'}
  442. '500': {$ref: '../components/responses.yaml#/InternalError'}
  443. DocumentDescription:
  444. parameters:
  445. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  446. put:
  447. operationId: updateDocumentDescription
  448. summary: 维护文档详细说明(主案/子案/附件通用,不校验rowVersion)
  449. parameters:
  450. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  451. requestBody:
  452. required: true
  453. content:
  454. application/json:
  455. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentDescriptionRequest'}
  456. responses:
  457. '200': {description: 保存后的文档详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  458. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  459. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  460. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  461. '404': {$ref: '../components/responses.yaml#/NotFound'}
  462. '500': {$ref: '../components/responses.yaml#/InternalError'}
  463. DocumentReExtract:
  464. parameters:
  465. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  466. post:
  467. operationId: reExtractDocumentContent
  468. summary: 重新提取文档正文(仅管理员,主案/子案/附件通用)
  469. description: |
  470. 按当前存储文件重新解析正文并回写 contentText/searchText 与提取状态;
  471. Office 类型(doc/wps/xls/xlsx/et)先经 LibreOffice 转 PDF 再提取。
  472. 提取结果(含失败原因 contentExtractError)覆盖写回,rowVersion 递增,
  473. 审计复用 EDIT_DOCUMENT(detail.scope=reExtractContent)。
  474. responses:
  475. '200': {description: 重新提取后的文档详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  476. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  477. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  478. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  479. '404': {$ref: '../components/responses.yaml#/NotFound'}
  480. '500': {$ref: '../components/responses.yaml#/InternalError'}
  481. DocumentPermissions:
  482. parameters:
  483. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  484. get:
  485. operationId: getDocumentPermissions
  486. summary: 查询主案权限或子方案继承权限
  487. parameters:
  488. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  489. responses:
  490. '200': {description: 权限详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/PermissionDetailResponse'}}}}
  491. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  492. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  493. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  494. '404': {$ref: '../components/responses.yaml#/NotFound'}
  495. '409': {$ref: '../components/responses.yaml#/Conflict'}
  496. '500': {$ref: '../components/responses.yaml#/InternalError'}
  497. put:
  498. operationId: saveDocumentPermissions
  499. summary: 全量保存主案权限
  500. parameters:
  501. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  502. requestBody:
  503. required: true
  504. content:
  505. application/json:
  506. schema: {$ref: '../components/schemas.yaml#/SavePermissionsRequest'}
  507. responses:
  508. '200': {description: 保存后的权限详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/PermissionDetailResponse'}}}}
  509. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  510. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  511. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  512. '404': {$ref: '../components/responses.yaml#/NotFound'}
  513. '409': {$ref: '../components/responses.yaml#/Conflict'}
  514. '500': {$ref: '../components/responses.yaml#/InternalError'}
  515. DocumentRelationPresets:
  516. get:
  517. operationId: listDocumentRelationPresets
  518. summary: 方案关联关系类型预置清单
  519. description: 启动期从document-relation-presets配置加载;预置类型用于编辑弹窗下拉,用户仍可自定义关系文本。
  520. parameters:
  521. - $ref: '../components/parameters.yaml#/XRequestId'
  522. responses:
  523. '200': {description: 预置关系清单, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentRelationPresetsResponse'}}}}
  524. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  525. '500': {$ref: '../components/responses.yaml#/InternalError'}
  526. DocumentRelations:
  527. parameters:
  528. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  529. get:
  530. operationId: listDocumentRelations
  531. summary: 查询方案声明的关联清单
  532. description: 与文档详情同套访问控制;被关联方进入回收站后自动隐藏,恢复后重新显示。
  533. parameters:
  534. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  535. responses:
  536. '200': {description: 关联清单, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentRelationsResponse'}}}}
  537. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  538. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  539. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  540. '404': {$ref: '../components/responses.yaml#/NotFound'}
  541. '500': {$ref: '../components/responses.yaml#/InternalError'}
  542. put:
  543. operationId: saveDocumentRelations
  544. summary: 整体替换方案的关联清单(管理员)
  545. description: |
  546. 关联发起方限主案/子方案,被关联方必须是主案且不可为自身;relations为空数组表示清空;
  547. relationType存最终文本(预置label或自定义,1~64字符);rowVersion乐观锁校验,
  548. 保存成功后rowVersion自增;设密主案需通过EDIT密码锁。
  549. parameters:
  550. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  551. requestBody:
  552. required: true
  553. content:
  554. application/json:
  555. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentRelationsRequest'}
  556. responses:
  557. '200': {description: 保存后的关联清单与新版本号, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentRelationsSaveResponse'}}}}
  558. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  559. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  560. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  561. '404': {$ref: '../components/responses.yaml#/NotFound'}
  562. '409': {$ref: '../components/responses.yaml#/Conflict'}
  563. '500': {$ref: '../components/responses.yaml#/InternalError'}
  564. MainPlanSubPlanBinding:
  565. parameters:
  566. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  567. post:
  568. operationId: bindMainPlanSubPlans
  569. summary: 批量挂载其他主案的子案到当前主案
  570. description: 仅建立展示关系,子案权限仍继承原主案;同一主案上的写入由主案行锁串行化。
  571. parameters:
  572. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  573. requestBody:
  574. required: true
  575. content:
  576. application/json:
  577. schema:
  578. type: object
  579. required: [subPlanIds, mainPlanRowVersion]
  580. additionalProperties: false
  581. properties:
  582. subPlanIds:
  583. type: array
  584. minItems: 1
  585. items: {$ref: '../components/schemas.yaml#/StringId'}
  586. mainPlanRowVersion: {type: integer, minimum: 0}
  587. responses:
  588. '200':
  589. description: 挂载结果
  590. content:
  591. application/json:
  592. schema:
  593. type: object
  594. required: [code, message, data, requestId]
  595. properties:
  596. code: {type: string}
  597. message: {type: string}
  598. requestId: {type: string}
  599. data:
  600. type: object
  601. required: [createdCount, existingCount, subPlanCount, mainPlanRowVersion]
  602. properties:
  603. createdCount: {type: integer, minimum: 0}
  604. existingCount: {type: integer, minimum: 0}
  605. subPlanCount: {type: integer, minimum: 0}
  606. mainPlanRowVersion: {type: integer, minimum: 0}
  607. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  608. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  609. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  610. '404': {$ref: '../components/responses.yaml#/NotFound'}
  611. '409': {$ref: '../components/responses.yaml#/Conflict'}
  612. '500': {$ref: '../components/responses.yaml#/InternalError'}
  613. MainPlanSubPlan:
  614. parameters:
  615. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  616. - {name: subPlanId, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  617. delete:
  618. operationId: unbindMainPlanSubPlan
  619. summary: 解除主案与已挂载子案的展示关系
  620. parameters:
  621. - {name: mainPlanRowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  622. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  623. responses:
  624. '200':
  625. description: 解除挂载结果
  626. content:
  627. application/json:
  628. schema:
  629. type: object
  630. required: [code, message, data, requestId]
  631. properties:
  632. code: {type: string}
  633. message: {type: string}
  634. requestId: {type: string}
  635. data:
  636. type: object
  637. required: [subPlanCount, mainPlanRowVersion]
  638. properties:
  639. subPlanCount: {type: integer, minimum: 0}
  640. mainPlanRowVersion: {type: integer, minimum: 0}
  641. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  642. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  643. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  644. '404': {$ref: '../components/responses.yaml#/NotFound'}
  645. '409': {$ref: '../components/responses.yaml#/Conflict'}
  646. '500': {$ref: '../components/responses.yaml#/InternalError'}