borrow-requests.yaml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. BorrowRequestCreate:
  2. parameters:
  3. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  4. post:
  5. operationId: createBorrowRequest
  6. summary: 提交借阅申请(一批用户共用一张可选PDF审批单)
  7. description: 契约1.37借阅申请审批流。multipart/form-data两个part——request(JSON对象字符串{entries,expiresAt},必须)+file(PDF审批单,可选);仅主案可申请,申请人须既无查看又无下载权限且密级足够;提交即向所有CONFIG_PERMISSION用户发APPROVAL+PENDING待办通知,响应{requestId,notified};任一条目用户已有待审批申请返回409 BORROW_REQUEST_DUPLICATE;审计BORROW_REQUEST_CREATE。敏感操作,强制二次认证(X-DMS-Reauth-Token,缺失或无效返回403 REAUTH_REQUIRED)。
  8. parameters:
  9. - $ref: '../components/parameters.yaml#/XDmsReauthToken'
  10. requestBody:
  11. required: true
  12. content:
  13. multipart/form-data:
  14. schema:
  15. type: object
  16. additionalProperties: false
  17. required: [request]
  18. properties:
  19. request:
  20. type: string
  21. description: 申请载荷JSON字符串(BorrowRequestCreateRequest)。
  22. file: {type: string, format: binary}
  23. responses:
  24. '200': {description: 申请受理结果(requestId与通知审批人数), content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BorrowRequestCreateResultResponse'}}}}
  25. '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
  26. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  27. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  28. '404': {$ref: '../components/responses.yaml#/NotFound'}
  29. '409': {$ref: '../components/responses.yaml#/Conflict'}
  30. '413': {$ref: '../components/responses.yaml#/PayloadTooLarge'}
  31. '415': {$ref: '../components/responses.yaml#/UnsupportedMedia'}
  32. '500': {$ref: '../components/responses.yaml#/InternalError'}
  33. BorrowRequestDetail:
  34. parameters:
  35. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  36. get:
  37. operationId: getBorrowRequestDetail
  38. summary: 查询借阅申请单详情
  39. description: 申请人本人或对该文档有授权权限的用户可见(审批人「查看审批单」);status为PENDING/APPROVED/REJECTED,任一审批人处理即定。
  40. parameters:
  41. - $ref: '../components/parameters.yaml#/XRequestId'
  42. responses:
  43. '200': {description: 申请单详情(含条目列表), content: {application/json: {schema: {$ref: '../components/schemas.yaml#/BorrowRequestDetailResponse'}}}}
  44. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  45. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  46. '404': {$ref: '../components/responses.yaml#/NotFound'}
  47. '500': {$ref: '../components/responses.yaml#/InternalError'}
  48. BorrowRequestVoucher:
  49. parameters:
  50. - {name: id, in: path, required: true, schema: {$ref: '../components/schemas.yaml#/StringId'}}
  51. get:
  52. operationId: downloadBorrowRequestVoucher
  53. summary: 下载借阅申请审批单
  54. description: 成功返回application/pdf附件二进制(含nosniff);可见性同申请详情;未上传审批单或文件缺失返回404。
  55. parameters:
  56. - $ref: '../components/parameters.yaml#/XRequestId'
  57. responses:
  58. '200': {description: 审批单PDF二进制, content: {application/pdf: {schema: {type: string, format: binary}}}}
  59. '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
  60. '403': {$ref: '../components/responses.yaml#/Forbidden'}
  61. '404': {$ref: '../components/responses.yaml#/NotFound'}
  62. '500': {$ref: '../components/responses.yaml#/InternalError'}