documents.yaml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  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: ADMIN分页查询独立共享附件库
  133. parameters:
  134. - $ref: '../components/parameters.yaml#/XRequestId'
  135. - {name: keyword, in: query, schema: {type: string}}
  136. - {name: attachmentType, in: query, schema: {$ref: '../components/schemas.yaml#/AttachmentType'}}
  137. - {name: fileExtension, in: query, schema: {type: string}}
  138. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  139. - $ref: '../components/parameters.yaml#/UpdatedTo'
  140. - name: sortBy
  141. in: query
  142. schema: {type: string, enum: [documentName, createdAt, updatedAt, viewCount, downloadCount], default: updatedAt}
  143. - {name: sortDirection, in: query, schema: {type: string, enum: [asc, desc], default: desc}}
  144. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  145. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  146. responses:
  147. '200': {description: 附件分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPageResponse'}}}}
  148. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  149. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  150. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  151. '404': {$ref: '../components/responses.yaml#/NotFound'}
  152. '500': {$ref: '../components/responses.yaml#/InternalError'}
  153. post:
  154. operationId: createAttachment
  155. summary: 上传共享附件
  156. requestBody:
  157. required: true
  158. content:
  159. multipart/form-data:
  160. schema:
  161. type: object
  162. additionalProperties: false
  163. required: [file, metadata]
  164. properties:
  165. file: {type: string, format: binary}
  166. metadata:
  167. type: string
  168. description: AttachmentCreateMetadata的JSON字符串。
  169. responses:
  170. '201': {description: 上传成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  171. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  172. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  173. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  174. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  175. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  176. '500': {$ref: '../components/responses.yaml#/InternalError'}
  177. Attachment:
  178. parameters:
  179. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  180. get:
  181. operationId: getAttachment
  182. summary: 查询共享附件详情
  183. responses:
  184. '200': {description: 附件详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  185. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  186. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  187. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  188. '404': {$ref: '../components/responses.yaml#/NotFound'}
  189. '500': {$ref: '../components/responses.yaml#/InternalError'}
  190. put:
  191. operationId: updateAttachment
  192. summary: 编辑共享附件元数据
  193. requestBody:
  194. required: true
  195. content:
  196. application/json:
  197. schema: {$ref: '../components/schemas.yaml#/UpdateAttachmentRequest'}
  198. responses:
  199. '200': {description: 编辑成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  200. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  201. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  202. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  203. '404': {$ref: '../components/responses.yaml#/NotFound'}
  204. '409': {$ref: '../components/responses.yaml#/Conflict'}
  205. '500': {$ref: '../components/responses.yaml#/InternalError'}
  206. delete:
  207. operationId: deleteAttachment
  208. summary: 逻辑删除共享附件
  209. parameters:
  210. - {name: rowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  211. responses:
  212. '200': {description: 删除成功, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DeleteDocumentResponse'}}}}
  213. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  214. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  215. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  216. '404': {$ref: '../components/responses.yaml#/NotFound'}
  217. '409': {$ref: '../components/responses.yaml#/Conflict'}
  218. '500': {$ref: '../components/responses.yaml#/InternalError'}
  219. DocumentBatchImport:
  220. post:
  221. operationId: batchImportDocuments
  222. summary: 批量导入主案和子方案
  223. requestBody:
  224. required: true
  225. content:
  226. multipart/form-data:
  227. schema:
  228. $ref: '../components/schemas.yaml#/BatchImportMultipart'
  229. responses:
  230. '200': {description: 逐文件导入结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BatchImportResponse'}}}}
  231. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  232. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  233. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  234. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  235. '500': {$ref: '../components/responses.yaml#/InternalError'}
  236. AttachmentBatchImport:
  237. post:
  238. operationId: batchImportAttachments
  239. summary: 批量导入共享附件
  240. requestBody:
  241. required: true
  242. content:
  243. multipart/form-data:
  244. schema:
  245. $ref: '../components/schemas.yaml#/BatchImportMultipart'
  246. responses:
  247. '200': {description: 逐文件导入结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BatchImportResponse'}}}}
  248. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  249. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  250. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  251. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  252. '500': {$ref: '../components/responses.yaml#/InternalError'}
  253. DocumentPreview:
  254. parameters:
  255. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  256. get:
  257. operationId: previewDocument
  258. summary: PDF直接预览;DOC、DOCX、WPS由LibreOffice离线转换为PDF后预览
  259. parameters:
  260. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  261. responses:
  262. '200':
  263. description: PDF文件流(PDF原文件或DOC/DOCX/WPS转换后的PDF)
  264. headers:
  265. X-Request-Id: {schema: {type: string, format: uuid}}
  266. content:
  267. application/pdf: {schema: {type: string, format: binary}}
  268. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  269. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  270. '404': {$ref: '../components/responses.yaml#/NotFound'}
  271. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  272. '502': {$ref: '../components/responses.yaml#/PreviewConversionFailed'}
  273. '503': {$ref: '../components/responses.yaml#/PreviewConverterUnavailable'}
  274. '504': {$ref: '../components/responses.yaml#/PreviewConversionTimeout'}
  275. '500': {$ref: '../components/responses.yaml#/InternalError'}
  276. DocumentDownload:
  277. parameters:
  278. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  279. get:
  280. operationId: downloadDocument
  281. summary: 下载原始文档
  282. parameters:
  283. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  284. responses:
  285. '200':
  286. description: 原始文件流
  287. headers:
  288. X-Request-Id: {schema: {type: string, format: uuid}}
  289. content:
  290. application/octet-stream: {schema: {type: string, format: binary}}
  291. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  292. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  293. '404': {$ref: '../components/responses.yaml#/NotFound'}
  294. '500': {$ref: '../components/responses.yaml#/InternalError'}
  295. AttachmentMainPlans:
  296. parameters:
  297. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  298. get:
  299. operationId: listAttachmentMainPlans
  300. summary: 查询共享附件挂载的可见主案
  301. responses:
  302. '200': {description: 主案简要集合, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/MainPlanBriefCollectionResponse'}}}}
  303. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  304. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  305. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  306. '404': {$ref: '../components/responses.yaml#/NotFound'}
  307. '500': {$ref: '../components/responses.yaml#/InternalError'}
  308. MainPlanAttachments:
  309. parameters:
  310. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  311. get:
  312. operationId: listMainPlanAttachments
  313. summary: 查询主案已挂载共享附件
  314. parameters:
  315. - {name: keyword, in: query, schema: {type: string}}
  316. - {name: attachmentType, in: query, schema: {$ref: '../components/schemas.yaml#/AttachmentType'}}
  317. - $ref: '../components/parameters.yaml#/UpdatedFrom'
  318. - $ref: '../components/parameters.yaml#/UpdatedTo'
  319. - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
  320. - {name: pageSize, in: query, schema: {type: integer, minimum: 1, maximum: 100, default: 20}}
  321. responses:
  322. '200': {description: 挂载附件分页, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/AttachmentBindingPageResponse'}}}}
  323. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  324. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  325. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  326. '404': {$ref: '../components/responses.yaml#/NotFound'}
  327. '500': {$ref: '../components/responses.yaml#/InternalError'}
  328. MainPlanAttachmentBinding:
  329. parameters:
  330. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  331. post:
  332. operationId: bindMainPlanAttachments
  333. summary: 批量挂载共享附件到主案
  334. parameters:
  335. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  336. requestBody:
  337. required: true
  338. content:
  339. application/json:
  340. schema: {$ref: '../components/schemas.yaml#/BindAttachmentsRequest'}
  341. responses:
  342. '200': {description: 挂载结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BindAttachmentsResponse'}}}}
  343. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  344. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  345. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  346. '404': {$ref: '../components/responses.yaml#/NotFound'}
  347. '409': {$ref: '../components/responses.yaml#/Conflict'}
  348. '500': {$ref: '../components/responses.yaml#/InternalError'}
  349. MainPlanAttachmentsReorder:
  350. parameters:
  351. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  352. put:
  353. operationId: reorderMainPlanAttachments
  354. summary: 调整主案下挂载附件的显示顺序
  355. description: 顺序存于挂载关系,同一附件在不同主案中可各自独立排序。
  356. parameters:
  357. - $ref: '../components/parameters.yaml#/XRequestId'
  358. requestBody:
  359. required: true
  360. content:
  361. application/json:
  362. schema: {$ref: '../components/schemas.yaml#/ReorderAttachmentsRequest'}
  363. responses:
  364. '200': {description: 重排结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/ReorderAttachmentsResponse'}}}}
  365. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  366. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  367. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  368. '404': {$ref: '../components/responses.yaml#/NotFound'}
  369. '409': {$ref: '../components/responses.yaml#/Conflict'}
  370. '500': {$ref: '../components/responses.yaml#/InternalError'}
  371. MainPlanAttachment:
  372. parameters:
  373. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  374. - {name: attachmentId, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  375. delete:
  376. operationId: unbindMainPlanAttachment
  377. summary: 解除主案和共享附件的挂载
  378. parameters:
  379. - {name: mainPlanRowVersion, in: query, required: true, schema: {type: integer, minimum: 0}}
  380. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  381. responses:
  382. '200': {description: 解除挂载结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/UnbindAttachmentResponse'}}}}
  383. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  384. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  385. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  386. '404': {$ref: '../components/responses.yaml#/NotFound'}
  387. '409': {$ref: '../components/responses.yaml#/Conflict'}
  388. '500': {$ref: '../components/responses.yaml#/InternalError'}
  389. DocumentsTags:
  390. get:
  391. operationId: listMainPlanTags
  392. summary: 聚合当前用户可见的主案标签
  393. description: 标签集合不随分类、关键词等筛选变化;按Unicode升序返回。
  394. parameters:
  395. - $ref: '../components/parameters.yaml#/XRequestId'
  396. responses:
  397. '200': {description: 标签集合, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentTagsResponse'}}}}
  398. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  399. '500': {$ref: '../components/responses.yaml#/InternalError'}
  400. DocumentsReorder:
  401. put:
  402. operationId: reorderDocuments
  403. summary: 管理员拖动重排主案/子方案
  404. description: 主案在全局范围排序,子方案在所属主案内排序,共享附件不支持;orderedIds为拖动后的目标顺序。
  405. parameters:
  406. - $ref: '../components/parameters.yaml#/XRequestId'
  407. requestBody:
  408. required: true
  409. content:
  410. application/json:
  411. schema: {$ref: '../components/schemas.yaml#/ReorderDocumentsRequest'}
  412. responses:
  413. '200': {description: 重排结果, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/ReorderDocumentsResponse'}}}}
  414. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  415. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  416. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  417. '404': {$ref: '../components/responses.yaml#/NotFound'}
  418. '409': {$ref: '../components/responses.yaml#/Conflict'}
  419. '500': {$ref: '../components/responses.yaml#/InternalError'}
  420. DocumentPassword:
  421. parameters:
  422. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  423. put:
  424. operationId: saveDocumentPassword
  425. summary: 设置/修改/清除主案密码锁(仅MAIN)
  426. description: |
  427. 未设密时设置:password+protectedActions必填;已设密时修改/清除:oldPassword必填且正确;
  428. password缺省或空表示清除。任何人(含ADMIN)修改/清除均需原密码;rowVersion乐观锁校验。
  429. requestBody:
  430. required: true
  431. content:
  432. application/json:
  433. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentPasswordRequest'}
  434. responses:
  435. '200': {description: 密码锁摘要, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentPasswordResponse'}}}}
  436. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  437. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  438. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  439. '404': {$ref: '../components/responses.yaml#/NotFound'}
  440. '409': {$ref: '../components/responses.yaml#/Conflict'}
  441. '500': {$ref: '../components/responses.yaml#/InternalError'}
  442. DocumentDescription:
  443. parameters:
  444. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  445. put:
  446. operationId: updateDocumentDescription
  447. summary: 维护文档详细说明(主案/子案/附件通用,不校验rowVersion)
  448. parameters:
  449. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  450. requestBody:
  451. required: true
  452. content:
  453. application/json:
  454. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentDescriptionRequest'}
  455. responses:
  456. '200': {description: 保存后的文档详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentDetailResponse'}}}}
  457. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  458. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  459. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  460. '404': {$ref: '../components/responses.yaml#/NotFound'}
  461. '500': {$ref: '../components/responses.yaml#/InternalError'}
  462. DocumentPermissions:
  463. parameters:
  464. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  465. get:
  466. operationId: getDocumentPermissions
  467. summary: 查询主案权限或子方案继承权限
  468. parameters:
  469. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  470. responses:
  471. '200': {description: 权限详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/PermissionDetailResponse'}}}}
  472. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  473. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  474. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  475. '404': {$ref: '../components/responses.yaml#/NotFound'}
  476. '409': {$ref: '../components/responses.yaml#/Conflict'}
  477. '500': {$ref: '../components/responses.yaml#/InternalError'}
  478. put:
  479. operationId: saveDocumentPermissions
  480. summary: 全量保存主案权限
  481. parameters:
  482. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  483. requestBody:
  484. required: true
  485. content:
  486. application/json:
  487. schema: {$ref: '../components/schemas.yaml#/SavePermissionsRequest'}
  488. responses:
  489. '200': {description: 保存后的权限详情, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/PermissionDetailResponse'}}}}
  490. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  491. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  492. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  493. '404': {$ref: '../components/responses.yaml#/NotFound'}
  494. '409': {$ref: '../components/responses.yaml#/Conflict'}
  495. '500': {$ref: '../components/responses.yaml#/InternalError'}
  496. DocumentRelationPresets:
  497. get:
  498. operationId: listDocumentRelationPresets
  499. summary: 方案关联关系类型预置清单
  500. description: 启动期从document-relation-presets配置加载;预置类型用于编辑弹窗下拉,用户仍可自定义关系文本。
  501. parameters:
  502. - $ref: '../components/parameters.yaml#/XRequestId'
  503. responses:
  504. '200': {description: 预置关系清单, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentRelationPresetsResponse'}}}}
  505. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  506. '500': {$ref: '../components/responses.yaml#/InternalError'}
  507. DocumentRelations:
  508. parameters:
  509. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  510. get:
  511. operationId: listDocumentRelations
  512. summary: 查询方案声明的关联清单
  513. description: 与文档详情同套访问控制;被关联方进入回收站后自动隐藏,恢复后重新显示。
  514. parameters:
  515. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  516. responses:
  517. '200': {description: 关联清单, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentRelationsResponse'}}}}
  518. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  519. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  520. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  521. '404': {$ref: '../components/responses.yaml#/NotFound'}
  522. '500': {$ref: '../components/responses.yaml#/InternalError'}
  523. put:
  524. operationId: saveDocumentRelations
  525. summary: 整体替换方案的关联清单(管理员)
  526. description: |
  527. 关联发起方限主案/子方案,被关联方必须是主案且不可为自身;relations为空数组表示清空;
  528. relationType存最终文本(预置label或自定义,1~64字符);rowVersion乐观锁校验,
  529. 保存成功后rowVersion自增;设密主案需通过EDIT密码锁。
  530. parameters:
  531. - $ref: '../components/parameters.yaml#/XDocumentPassword'
  532. requestBody:
  533. required: true
  534. content:
  535. application/json:
  536. schema: {$ref: '../components/schemas.yaml#/UpdateDocumentRelationsRequest'}
  537. responses:
  538. '200': {description: 保存后的关联清单与新版本号, content: {application/json: {schema: {$ref: '../components/schemas.yaml#/DocumentRelationsSaveResponse'}}}}
  539. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  540. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  541. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  542. '404': {$ref: '../components/responses.yaml#/NotFound'}
  543. '409': {$ref: '../components/responses.yaml#/Conflict'}
  544. '500': {$ref: '../components/responses.yaml#/InternalError'}