v2-share.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-share.yaml
  2. get:
  3. summary: '列出 share'
  4. tags:
  5. - share
  6. operationId: get_api_v2_share
  7. description: 实现:`ShareController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - res
  16. - group
  17. -
  18. name: id
  19. in: query
  20. schema:
  21. type: string
  22. -
  23. name: offset
  24. in: query
  25. schema:
  26. type: string
  27. -
  28. name: limit
  29. in: query
  30. schema:
  31. type: string
  32. -
  33. name: search
  34. in: query
  35. description: 搜索关键字
  36. schema:
  37. type: string
  38. -
  39. name: order
  40. in: query
  41. description: 排序字段
  42. schema:
  43. type: string
  44. -
  45. name: dir
  46. in: query
  47. description: 排序方向
  48. schema:
  49. type: string
  50. enum:
  51. - desc
  52. - asc
  53. responses:
  54. 200:
  55. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  56. content:
  57. application/json:
  58. schema:
  59. type: object
  60. properties:
  61. ok:
  62. type: boolean
  63. message:
  64. type: string
  65. data:
  66. type: object
  67. properties:
  68. rows:
  69. type: array
  70. items:
  71. type: object
  72. properties: { id: { type: integer }, res_id: { type: integer }, res_type: { type: string }, collaborator_type: { type: string }, power: { type: string }, res_name: { type: string }, owner: { type: string }, created_at: { type: string }, updated_at: { type: string }, user: { type: string }, group: { type: string } }
  73. count:
  74. type: integer
  75. 401:
  76. $ref: '../../main.yaml#/components/responses/Unauthorized'
  77. 422:
  78. $ref: '../../main.yaml#/components/responses/ValidationError'
  79. post:
  80. summary: '新建 share'
  81. tags:
  82. - share
  83. operationId: post_api_v2_share
  84. description: 实现:`ShareController@store`
  85. requestBody:
  86. required: false
  87. content:
  88. application/json:
  89. schema:
  90. type: object
  91. properties:
  92. user_id:
  93. type: string
  94. res_id:
  95. type: string
  96. res_type:
  97. type: string
  98. user_type:
  99. type: string
  100. role:
  101. type: string
  102. enum:
  103. - manager
  104. - editor
  105. - reader
  106. responses:
  107. 200:
  108. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  109. content:
  110. application/json:
  111. schema:
  112. type: object
  113. properties:
  114. ok:
  115. type: boolean
  116. message:
  117. type: string
  118. data:
  119. type: object
  120. 401:
  121. $ref: '../../main.yaml#/components/responses/Unauthorized'
  122. 422:
  123. $ref: '../../main.yaml#/components/responses/ValidationError'