v2-attachment.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-attachment.yaml
  2. get:
  3. summary: '列出 attachment'
  4. tags:
  5. - attachment
  6. operationId: get_api_v2_attachment
  7. description: 实现:`AttachmentController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - studio
  16. -
  17. name: studio
  18. in: query
  19. schema:
  20. type: string
  21. -
  22. name: search
  23. in: query
  24. schema:
  25. type: string
  26. -
  27. name: content_type
  28. in: query
  29. schema:
  30. type: string
  31. -
  32. name: order
  33. in: query
  34. schema:
  35. type: string
  36. default: updated_at
  37. -
  38. name: dir
  39. in: query
  40. schema:
  41. type: string
  42. default: desc
  43. -
  44. name: offset
  45. in: query
  46. schema:
  47. type: string
  48. -
  49. name: limit
  50. in: query
  51. schema:
  52. type: string
  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 }, user_uid: { type: string }, name: { type: string }, filename: { type: string }, title: { type: string }, size: { type: string }, content_type: { type: string }, status: { type: integer }, created_at: { type: string }, updated_at: { type: string }, small: { type: string }, middle: { type: string }, url: { type: string }, thumbnail: { 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: '新建 attachment'
  81. tags:
  82. - attachment
  83. operationId: post_api_v2_attachment
  84. description: 实现:`AttachmentController@store`
  85. requestBody:
  86. required: true
  87. content:
  88. application/json:
  89. schema:
  90. type: object
  91. properties:
  92. file:
  93. type: string
  94. description: 规则:required
  95. id:
  96. type: string
  97. type:
  98. type: string
  99. studio:
  100. type: string
  101. required:
  102. - file
  103. responses:
  104. 200:
  105. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  106. content:
  107. application/json:
  108. schema:
  109. type: object
  110. properties:
  111. ok:
  112. type: boolean
  113. message:
  114. type: string
  115. data:
  116. type: object
  117. properties:
  118. id:
  119. type: integer
  120. user_uid:
  121. type: string
  122. name:
  123. type: string
  124. filename:
  125. type: string
  126. title:
  127. type: string
  128. size:
  129. type: string
  130. content_type:
  131. type: string
  132. status:
  133. type: integer
  134. created_at:
  135. type: string
  136. updated_at:
  137. type: string
  138. small:
  139. type: string
  140. middle:
  141. type: string
  142. url:
  143. type: string
  144. thumbnail:
  145. type: string
  146. 401:
  147. $ref: '../../main.yaml#/components/responses/Unauthorized'
  148. 422:
  149. $ref: '../../main.yaml#/components/responses/ValidationError'