v3-channels-channel.yaml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-channels-channel.yaml
  2. get:
  3. summary: 'channel 详情'
  4. tags:
  5. - channels
  6. operationId: get_api_v3_channels_channel_
  7. description: |-
  8. 公开的谁都能看;私有的只有拥有者、团队成员、被共享的人能看。带查看者的 `abilities`。
  9. 实现:`V3\ChannelController@show`
  10. security:
  11. - { }
  12. -
  13. bearerAuth: []
  14. parameters:
  15. -
  16. name: channel
  17. in: path
  18. required: true
  19. schema:
  20. type: string
  21. description: 'channel uid'
  22. responses:
  23. 200:
  24. description: 成功
  25. content:
  26. application/json:
  27. schema:
  28. type: object
  29. properties:
  30. data:
  31. type: object
  32. properties:
  33. id:
  34. type: string
  35. name:
  36. type: string
  37. summary:
  38. type: string
  39. nullable: true
  40. type:
  41. type: string
  42. lang:
  43. type: string
  44. status:
  45. type: integer
  46. is_system:
  47. type: boolean
  48. source_type:
  49. type: string
  50. source_id:
  51. type: string
  52. nullable: true
  53. owner:
  54. type: object
  55. properties:
  56. kind: { type: string }
  57. id: { type: string }
  58. nickName: { type: string }
  59. realName: { type: string }
  60. avatar: { type: string, nullable: true }
  61. abilities:
  62. type: object
  63. properties:
  64. read: { type: boolean }
  65. write: { type: boolean }
  66. update: { type: boolean }
  67. delete: { type: boolean }
  68. progress:
  69. type: number
  70. nullable: true
  71. description: 仅在部分查询口径下返回。
  72. created_at:
  73. type: string
  74. updated_at:
  75. type: string
  76. 403:
  77. description: '私有 channel,且看不见'
  78. content:
  79. application/problem+json:
  80. schema:
  81. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  82. 422:
  83. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  84. delete:
  85. summary: '删除 channel'
  86. tags:
  87. - channels
  88. operationId: delete_api_v3_channels_channel_
  89. description: |-
  90. 软删除,返回被删的 channel。个人 channel 由拥有者删,团队的只有团队 owner 能删。
  91. channel 下已有译文、术语或逐词时拒绝(409,`content` 列出有哪几类)。系统 channel 不能删。
  92. 实现:`V3\ChannelController@destroy`
  93. security:
  94. -
  95. bearerAuth: []
  96. parameters:
  97. -
  98. name: channel
  99. in: path
  100. required: true
  101. schema:
  102. type: string
  103. description: 'channel uid'
  104. responses:
  105. 200:
  106. description: 成功
  107. content:
  108. application/json:
  109. schema:
  110. type: object
  111. properties:
  112. data:
  113. type: object
  114. properties:
  115. id:
  116. type: string
  117. name:
  118. type: string
  119. summary:
  120. type: string
  121. nullable: true
  122. type:
  123. type: string
  124. lang:
  125. type: string
  126. status:
  127. type: integer
  128. is_system:
  129. type: boolean
  130. source_type:
  131. type: string
  132. source_id:
  133. type: string
  134. nullable: true
  135. owner:
  136. type: object
  137. properties:
  138. kind: { type: string }
  139. id: { type: string }
  140. nickName: { type: string }
  141. realName: { type: string }
  142. avatar: { type: string, nullable: true }
  143. abilities:
  144. type: object
  145. properties:
  146. read: { type: boolean }
  147. write: { type: boolean }
  148. update: { type: boolean }
  149. delete: { type: boolean }
  150. progress:
  151. type: number
  152. nullable: true
  153. description: 仅在部分查询口径下返回。
  154. created_at:
  155. type: string
  156. updated_at:
  157. type: string
  158. 401:
  159. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  160. 403:
  161. description: 不能删除
  162. content:
  163. application/problem+json:
  164. schema:
  165. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  166. 409:
  167. description: 'channel 下还有内容'
  168. content:
  169. application/problem+json:
  170. schema:
  171. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  172. 422:
  173. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  174. patch:
  175. summary: '改 channel 信息'
  176. tags:
  177. - channels
  178. operationId: patch_api_v3_channels_channel_
  179. description: |-
  180. 只改传了的字段。拥有者;团队的 channel 由团队 owner / manager / editor 改;共享权限 ≥30 也能改。
  181. 系统 channel 不能改。AI 模型不能改。
  182. 实现:`V3\ChannelController@update`
  183. security:
  184. -
  185. bearerAuth: []
  186. parameters:
  187. -
  188. name: channel
  189. in: path
  190. required: true
  191. schema:
  192. type: string
  193. description: 'channel uid'
  194. requestBody:
  195. required: false
  196. content:
  197. application/json:
  198. schema:
  199. type: object
  200. properties:
  201. name:
  202. type: string
  203. description: '名字,最长 128;同一 studio 内不能重名'
  204. type:
  205. type: string
  206. description: 类型
  207. enum:
  208. - translation
  209. - nissaya
  210. - original
  211. - wbw
  212. - commentary
  213. - similar
  214. lang:
  215. type: string
  216. description: '语言,最长 16'
  217. summary:
  218. type: string
  219. description: '简介,最长 1024'
  220. status:
  221. type: integer
  222. description: '10 私有、20 公开不列出(拿到链接能看,不进任何公开列表)、30 公开'
  223. source_type:
  224. type: string
  225. description: 来源
  226. enum:
  227. - original
  228. - reprint
  229. - ai
  230. source_id:
  231. type: string
  232. description: '来源 id'
  233. config:
  234. type: object
  235. description: 配置
  236. responses:
  237. 200:
  238. description: 成功
  239. content:
  240. application/json:
  241. schema:
  242. type: object
  243. properties:
  244. data:
  245. type: object
  246. properties:
  247. id:
  248. type: string
  249. name:
  250. type: string
  251. summary:
  252. type: string
  253. nullable: true
  254. type:
  255. type: string
  256. lang:
  257. type: string
  258. status:
  259. type: integer
  260. is_system:
  261. type: boolean
  262. source_type:
  263. type: string
  264. source_id:
  265. type: string
  266. nullable: true
  267. owner:
  268. type: object
  269. properties:
  270. kind: { type: string }
  271. id: { type: string }
  272. nickName: { type: string }
  273. realName: { type: string }
  274. avatar: { type: string, nullable: true }
  275. abilities:
  276. type: object
  277. properties:
  278. read: { type: boolean }
  279. write: { type: boolean }
  280. update: { type: boolean }
  281. delete: { type: boolean }
  282. progress:
  283. type: number
  284. nullable: true
  285. description: 仅在部分查询口径下返回。
  286. created_at:
  287. type: string
  288. updated_at:
  289. type: string
  290. 401:
  291. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  292. 403:
  293. description: 不能修改
  294. content:
  295. application/problem+json:
  296. schema:
  297. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  298. 422:
  299. $ref: '../../main.yaml#/components/responses/ProblemValidation'