v2-channel-channel.yaml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-channel-channel.yaml
  2. get:
  3. summary: '获取单个 channel'
  4. tags:
  5. - channel
  6. operationId: get_api_v2_channel_channel_
  7. description: |-
  8. 返回 channel 详情,附带所属 studio 与作者信息。
  9. 实现:`ChannelController@show`
  10. parameters:
  11. -
  12. name: channel
  13. in: path
  14. required: true
  15. schema:
  16. type: string
  17. description: 'channel uid'
  18. responses:
  19. 200:
  20. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  21. content:
  22. application/json:
  23. schema:
  24. type: object
  25. properties:
  26. ok:
  27. type: boolean
  28. message:
  29. type: string
  30. data:
  31. type: object
  32. properties:
  33. uid:
  34. type: string
  35. name:
  36. type: string
  37. summary:
  38. type: string
  39. nullable: true
  40. lang:
  41. type: string
  42. type:
  43. type: string
  44. updated_at:
  45. type: string
  46. studio:
  47. type: object
  48. properties:
  49. id: { type: string }
  50. nickName: { type: string }
  51. realName: { type: string }
  52. studioName: { type: string }
  53. avatar: { type: string }
  54. 401:
  55. $ref: '../../main.yaml#/components/responses/Unauthorized'
  56. 422:
  57. $ref: '../../main.yaml#/components/responses/ValidationError'
  58. put:
  59. summary: '整体更新 channel'
  60. tags:
  61. - channel
  62. operationId: put_api_v2_channel_channel_
  63. description: |-
  64. 覆盖式更新,未传的字段会被写成 null;只改部分字段请用 PATCH /channel。
  65. 系统 channel 不可修改;非 owner 需要 30 以上的协作权限。
  66. 实现:`ChannelController@update`
  67. parameters:
  68. -
  69. name: channel
  70. in: path
  71. required: true
  72. schema:
  73. type: string
  74. description: 'channel uid'
  75. requestBody:
  76. required: true
  77. content:
  78. application/json:
  79. schema:
  80. type: object
  81. properties:
  82. id:
  83. type: string
  84. name:
  85. type: string
  86. description: 'channel 名称'
  87. type:
  88. type: integer
  89. description: 'channel 类型'
  90. summary:
  91. type: string
  92. description: 简介
  93. lang:
  94. type: string
  95. description: 译文语言代码
  96. status:
  97. type: integer
  98. description: '状态。30 为全网公开'
  99. source_type:
  100. type: string
  101. description: 来源类型,传入才会更新
  102. source_id:
  103. type: string
  104. description: '来源 id,传入才会更新'
  105. required:
  106. - name
  107. - type
  108. - summary
  109. - lang
  110. - status
  111. responses:
  112. 200:
  113. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  114. content:
  115. application/json:
  116. schema:
  117. type: object
  118. properties:
  119. ok:
  120. type: boolean
  121. message:
  122. type: string
  123. data:
  124. type: object
  125. 401:
  126. $ref: '../../main.yaml#/components/responses/Unauthorized'
  127. 422:
  128. $ref: '../../main.yaml#/components/responses/ValidationError'
  129. patch:
  130. summary: '整体更新 channel'
  131. tags:
  132. - channel
  133. operationId: patch_api_v2_channel_channel_
  134. description: |-
  135. 覆盖式更新,未传的字段会被写成 null;只改部分字段请用 PATCH /channel。
  136. 系统 channel 不可修改;非 owner 需要 30 以上的协作权限。
  137. 实现:`ChannelController@update`
  138. parameters:
  139. -
  140. name: channel
  141. in: path
  142. required: true
  143. schema:
  144. type: string
  145. description: 'channel uid'
  146. requestBody:
  147. required: true
  148. content:
  149. application/json:
  150. schema:
  151. type: object
  152. properties:
  153. id:
  154. type: string
  155. name:
  156. type: string
  157. description: 'channel 名称'
  158. type:
  159. type: integer
  160. description: 'channel 类型'
  161. summary:
  162. type: string
  163. description: 简介
  164. lang:
  165. type: string
  166. description: 译文语言代码
  167. status:
  168. type: integer
  169. description: '状态。30 为全网公开'
  170. source_type:
  171. type: string
  172. description: 来源类型,传入才会更新
  173. source_id:
  174. type: string
  175. description: '来源 id,传入才会更新'
  176. required:
  177. - name
  178. - type
  179. - summary
  180. - lang
  181. - status
  182. responses:
  183. 200:
  184. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  185. content:
  186. application/json:
  187. schema:
  188. type: object
  189. properties:
  190. ok:
  191. type: boolean
  192. message:
  193. type: string
  194. data:
  195. type: object
  196. 401:
  197. $ref: '../../main.yaml#/components/responses/Unauthorized'
  198. 422:
  199. $ref: '../../main.yaml#/components/responses/ValidationError'
  200. delete:
  201. summary: '删除 channel'
  202. tags:
  203. - channel
  204. operationId: delete_api_v2_channel_channel_
  205. description: |-
  206. 只有 owner 可以删除。channel 下已有译文、术语或逐词解析数据时拒绝删除。
  207. 实现:`ChannelController@destroy`
  208. parameters:
  209. -
  210. name: channel
  211. in: path
  212. required: true
  213. schema:
  214. type: string
  215. description: 'channel uid'
  216. responses:
  217. 200:
  218. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  219. content:
  220. application/json:
  221. schema:
  222. type: object
  223. properties:
  224. ok:
  225. type: boolean
  226. message:
  227. type: string
  228. data:
  229. type: object
  230. 401:
  231. $ref: '../../main.yaml#/components/responses/Unauthorized'
  232. 422:
  233. $ref: '../../main.yaml#/components/responses/ValidationError'