v3-channels-channel-links.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-channels-channel-links.yaml
  2. get:
  3. summary: 'channel 的关系设置'
  4. tags:
  5. - channels
  6. operationId: get_api_v3_channels_channel_links
  7. description: |-
  8. 能读这个 channel 的人都能看。指向的 channel 已删除、或查看者看不见的,不出现在结果里。
  9. `can_update` 表示查看者能不能改。
  10. 实现:`V3\ChannelLinkController@show`
  11. security:
  12. - { }
  13. -
  14. bearerAuth: []
  15. parameters:
  16. -
  17. name: channel
  18. in: path
  19. required: true
  20. schema:
  21. type: string
  22. description: 'channel uid'
  23. responses:
  24. 200:
  25. description: 成功
  26. content:
  27. application/json:
  28. schema:
  29. type: object
  30. properties:
  31. data:
  32. type: object
  33. properties:
  34. channel_id:
  35. type: string
  36. derived_from:
  37. type: object
  38. properties:
  39. id: { type: string }
  40. name: { type: string }
  41. type: { type: string }
  42. lang: { type: string }
  43. status: { type: integer }
  44. nullable: true
  45. wbw:
  46. type: object
  47. properties:
  48. id: { type: string }
  49. name: { type: string }
  50. type: { type: string }
  51. lang: { type: string }
  52. status: { type: integer }
  53. nullable: true
  54. fallback:
  55. type: array
  56. items:
  57. type: object
  58. properties: { id: { type: string }, name: { type: string }, type: { type: string }, lang: { type: string }, status: { type: integer } }
  59. term_source:
  60. type: array
  61. items:
  62. type: object
  63. properties: { id: { type: string }, name: { type: string }, type: { type: string }, lang: { type: string }, status: { type: integer } }
  64. can_update:
  65. type: boolean
  66. 403:
  67. description: '私有 channel,且看不见'
  68. content:
  69. application/problem+json:
  70. schema:
  71. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  72. 422:
  73. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  74. patch:
  75. summary: '改 channel 的关系设置'
  76. tags:
  77. - channels
  78. operationId: patch_api_v3_channels_channel_links
  79. description: |-
  80. 传了哪个键就整体替换哪一种关系,没传的不动;单值传 null 清掉,列表传 [] 清空。
  81. 能改 channel 信息的人才能改(拥有者、团队 owner / manager / editor、共享权限 ≥30)。AI 模型不能改。
  82. 目标必须是你看得见的 channel,且不能是自己。降级版本必须与本 channel 同类型;
  83. 术语路径只有 translation channel 能设,目标也只能是 translation(传 [] 清空总是允许)。
  84. 实现:`V3\ChannelLinkController@update`
  85. security:
  86. -
  87. bearerAuth: []
  88. parameters:
  89. -
  90. name: channel
  91. in: path
  92. required: true
  93. schema:
  94. type: string
  95. description: 'channel uid'
  96. requestBody:
  97. required: false
  98. content:
  99. application/json:
  100. schema:
  101. type: object
  102. properties:
  103. derived_from:
  104. type: string
  105. nullable: true
  106. description: '继承自哪个 channel(如英文版译自中文版),只记录'
  107. wbw:
  108. type: string
  109. nullable: true
  110. description: '捆绑的逐词 channel,必须是 wbw 类型;载入时当原文'
  111. fallback:
  112. type: array
  113. description: '降级 channel,有序,最多 3 个,须与本 channel 同类型;段落没有数据时由客户端改取'
  114. items:
  115. type: string
  116. description: 'channel uid'
  117. term_source:
  118. type: array
  119. description: '术语路径,有序,最多 10 个,只能是 translation;只有 translation channel 能设'
  120. items:
  121. type: string
  122. description: 'channel uid'
  123. responses:
  124. 200:
  125. description: 成功
  126. content:
  127. application/json:
  128. schema:
  129. type: object
  130. properties:
  131. data:
  132. type: object
  133. properties:
  134. channel_id:
  135. type: string
  136. derived_from:
  137. type: object
  138. properties:
  139. id: { type: string }
  140. name: { type: string }
  141. type: { type: string }
  142. lang: { type: string }
  143. status: { type: integer }
  144. nullable: true
  145. wbw:
  146. type: object
  147. properties:
  148. id: { type: string }
  149. name: { type: string }
  150. type: { type: string }
  151. lang: { type: string }
  152. status: { type: integer }
  153. nullable: true
  154. fallback:
  155. type: array
  156. items:
  157. type: object
  158. properties: { id: { type: string }, name: { type: string }, type: { type: string }, lang: { type: string }, status: { type: integer } }
  159. term_source:
  160. type: array
  161. items:
  162. type: object
  163. properties: { id: { type: string }, name: { type: string }, type: { type: string }, lang: { type: string }, status: { type: integer } }
  164. can_update:
  165. type: boolean
  166. 401:
  167. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  168. 403:
  169. description: 不能修改
  170. content:
  171. application/problem+json:
  172. schema:
  173. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  174. 422:
  175. $ref: '../../main.yaml#/components/responses/ProblemValidation'