v2-terms-term.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-terms-term.yaml
  2. get:
  3. summary: 查询单条术语
  4. tags:
  5. - terms
  6. operationId: get_api_v2_terms_term_
  7. description: |
  8. 已被 `GET /v3/terms/{term}` 取代(正文是新渲染器的「摘要 + 正文」,节点树 `body` 或 `format=html` 的 `html`;
  9. 可用 `channels` / `mode` 指定渲染版本与模式)。保留仅为 dashboard-v4、旧客户端兼容,待 v4 下线后删除。
  10. parameters:
  11. -
  12. name: term
  13. in: path
  14. required: true
  15. schema:
  16. type: string
  17. -
  18. name: channel
  19. in: query
  20. schema:
  21. type: string
  22. description: '渲染 note 时使用的 channel 列表,多个用下划线分隔; 不传则按术语自身的 channel 或对应语言的社区 channel 渲染'
  23. -
  24. name: mode
  25. in: query
  26. schema:
  27. type: string
  28. default: read
  29. description: 渲染模式
  30. -
  31. name: format
  32. in: query
  33. schema:
  34. type: string
  35. enum:
  36. - react
  37. - html
  38. - text
  39. default: react
  40. description: 'note 的渲染输出格式'
  41. -
  42. name: community_summary
  43. in: query
  44. schema:
  45. type: boolean
  46. description: '传入该参数时,没有 note 的术语回落到社区解释作为 summary'
  47. -
  48. name: exp
  49. in: query
  50. schema:
  51. type: boolean
  52. description: 传入该参数时附带编辑者累计经验值(秒)
  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. id:
  69. type: integer
  70. guid:
  71. type: string
  72. word:
  73. type: string
  74. word_en:
  75. type: string
  76. meaning:
  77. type: string
  78. other_meaning:
  79. type: string
  80. tag:
  81. type: string
  82. note:
  83. type: string
  84. language:
  85. type: string
  86. channel_id:
  87. type: integer
  88. channal:
  89. type: string
  90. studio:
  91. type: string
  92. editor:
  93. type: string
  94. created_at:
  95. type: string
  96. updated_at:
  97. type: string
  98. mode:
  99. type: string
  100. format:
  101. type: string
  102. studioId:
  103. type: string
  104. channel:
  105. type: string
  106. html:
  107. type: string
  108. summary_is_community:
  109. type: string
  110. summary:
  111. type: string
  112. role:
  113. type: string
  114. exp:
  115. type: string
  116. 401:
  117. $ref: '../../main.yaml#/components/responses/Unauthorized'
  118. 422:
  119. $ref: '../../main.yaml#/components/responses/ValidationError'
  120. deprecated: true
  121. put:
  122. summary: 修改术语
  123. tags:
  124. - terms
  125. operationId: put_api_v2_terms_term_
  126. description: |
  127. 已被 `PATCH /v3/terms/{term}` 取代(只有 PATCH;必须带 `If-Match`;word / tag 建立后不能改)。
  128. 保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
  129. parameters:
  130. -
  131. name: term
  132. in: path
  133. required: true
  134. schema:
  135. type: string
  136. requestBody:
  137. required: false
  138. content:
  139. application/json:
  140. schema:
  141. type: object
  142. properties:
  143. access_token:
  144. type: string
  145. description: 'channel access token,供非 owner 身份验证 channel 编辑权'
  146. word:
  147. type: string
  148. description: '术语词形,提交时同步重算 word_en'
  149. meaning:
  150. type: string
  151. description: 主要义项
  152. other_meaning:
  153. type: string
  154. description: 其他义项,逗号分隔
  155. note:
  156. type: string
  157. description: 术语解释,Markdown
  158. tag:
  159. type: string
  160. description: 标签
  161. language:
  162. type: string
  163. description: 语言
  164. responses:
  165. 200:
  166. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  167. content:
  168. application/json:
  169. schema:
  170. type: object
  171. properties:
  172. ok:
  173. type: boolean
  174. message:
  175. type: string
  176. data:
  177. type: object
  178. properties:
  179. id:
  180. type: integer
  181. guid:
  182. type: string
  183. word:
  184. type: string
  185. word_en:
  186. type: string
  187. meaning:
  188. type: string
  189. other_meaning:
  190. type: string
  191. tag:
  192. type: string
  193. note:
  194. type: string
  195. language:
  196. type: string
  197. channel_id:
  198. type: integer
  199. channal:
  200. type: string
  201. studio:
  202. type: string
  203. editor:
  204. type: string
  205. created_at:
  206. type: string
  207. updated_at:
  208. type: string
  209. mode:
  210. type: string
  211. format:
  212. type: string
  213. studioId:
  214. type: string
  215. channel:
  216. type: string
  217. html:
  218. type: string
  219. summary_is_community:
  220. type: string
  221. summary:
  222. type: string
  223. role:
  224. type: string
  225. exp:
  226. type: string
  227. 401:
  228. $ref: '../../main.yaml#/components/responses/Unauthorized'
  229. 422:
  230. $ref: '../../main.yaml#/components/responses/ValidationError'
  231. deprecated: true
  232. patch:
  233. summary: 修改术语
  234. tags:
  235. - terms
  236. operationId: patch_api_v2_terms_term_
  237. description: |
  238. 已被 `PATCH /v3/terms/{term}` 取代(必须带 `If-Match`;word / tag 建立后不能改)。
  239. 保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
  240. parameters:
  241. -
  242. name: term
  243. in: path
  244. required: true
  245. schema:
  246. type: string
  247. requestBody:
  248. required: false
  249. content:
  250. application/json:
  251. schema:
  252. type: object
  253. properties:
  254. access_token:
  255. type: string
  256. description: 'channel access token,供非 owner 身份验证 channel 编辑权'
  257. word:
  258. type: string
  259. description: '术语词形,提交时同步重算 word_en'
  260. meaning:
  261. type: string
  262. description: 主要义项
  263. other_meaning:
  264. type: string
  265. description: 其他义项,逗号分隔
  266. note:
  267. type: string
  268. description: 术语解释,Markdown
  269. tag:
  270. type: string
  271. description: 标签
  272. language:
  273. type: string
  274. description: 语言
  275. responses:
  276. 200:
  277. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  278. content:
  279. application/json:
  280. schema:
  281. type: object
  282. properties:
  283. ok:
  284. type: boolean
  285. message:
  286. type: string
  287. data:
  288. type: object
  289. properties:
  290. id:
  291. type: integer
  292. guid:
  293. type: string
  294. word:
  295. type: string
  296. word_en:
  297. type: string
  298. meaning:
  299. type: string
  300. other_meaning:
  301. type: string
  302. tag:
  303. type: string
  304. note:
  305. type: string
  306. language:
  307. type: string
  308. channel_id:
  309. type: integer
  310. channal:
  311. type: string
  312. studio:
  313. type: string
  314. editor:
  315. type: string
  316. created_at:
  317. type: string
  318. updated_at:
  319. type: string
  320. mode:
  321. type: string
  322. format:
  323. type: string
  324. studioId:
  325. type: string
  326. channel:
  327. type: string
  328. html:
  329. type: string
  330. summary_is_community:
  331. type: string
  332. summary:
  333. type: string
  334. role:
  335. type: string
  336. exp:
  337. type: string
  338. 401:
  339. $ref: '../../main.yaml#/components/responses/Unauthorized'
  340. 422:
  341. $ref: '../../main.yaml#/components/responses/ValidationError'
  342. deprecated: true
  343. delete:
  344. summary: 批量删除术语
  345. tags:
  346. - terms
  347. operationId: delete_api_v2_terms_term_
  348. description: |
  349. 已被 `DELETE /v3/terms/{term}` 取代(一次一条、软删除,返回被删的术语;v2 的 body 里传一批 id 不再支持)。
  350. 保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
  351. parameters:
  352. -
  353. name: term
  354. in: path
  355. required: true
  356. schema:
  357. type: string
  358. -
  359. name: uuid
  360. in: query
  361. schema:
  362. type: string
  363. description: '存在该参数即表示 id 以数组形式提交,并启用 channel 协作者删除权限判定'
  364. -
  365. name: id
  366. in: query
  367. schema:
  368. type: array
  369. description: '要删除的术语 id 列表。带 uuid 时为数组,否则为 JSON 数组字符串'
  370. required: true
  371. responses:
  372. 200:
  373. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  374. content:
  375. application/json:
  376. schema:
  377. type: object
  378. properties:
  379. ok:
  380. type: boolean
  381. message:
  382. type: string
  383. data:
  384. type: object
  385. 401:
  386. $ref: '../../main.yaml#/components/responses/Unauthorized'
  387. 422:
  388. $ref: '../../main.yaml#/components/responses/ValidationError'
  389. deprecated: true