v3-channels-channel-terms.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-channels-channel-terms.yaml
  2. get:
  3. summary: 'channel 的术语列表'
  4. tags:
  5. - channels
  6. operationId: get_api_v3_channels_channel_terms
  7. description: |-
  8. 能读 channel 的人都能看。请求头 `Accept` 是
  9. `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` 时导出成 xlsx:整表(过滤同列表、不分页),
  10. 列为 id / word / tag / meaning / other_meaning / summary / note / quality / content_type / redirect / language /
  11. channel_id / etag,可改后用导入接口传回(取代 v2 `terms-export`)。
  12. 实现:`V3\ChannelTermController@index`
  13. security:
  14. - { }
  15. -
  16. bearerAuth: []
  17. parameters:
  18. -
  19. name: channel
  20. in: path
  21. required: true
  22. schema:
  23. type: string
  24. description: 'channel uid'
  25. -
  26. name: per_page
  27. in: query
  28. schema:
  29. type: integer
  30. default: 20
  31. description: '每页条数,最大 200'
  32. -
  33. name: search
  34. in: query
  35. schema:
  36. type: string
  37. description: 按词、释义搜索
  38. -
  39. name: quality
  40. in: query
  41. schema:
  42. type: string
  43. enum:
  44. - featured
  45. - standard
  46. - draft
  47. - pending
  48. description: '质量;pending 含未评级的'
  49. -
  50. name: category
  51. in: query
  52. schema:
  53. type: string
  54. description: 百科分类
  55. -
  56. name: order
  57. in: query
  58. schema:
  59. type: string
  60. enum:
  61. - updated_at
  62. - created_at
  63. - word
  64. default: updated_at
  65. description: 排序字段
  66. -
  67. name: dir
  68. in: query
  69. schema:
  70. type: string
  71. enum:
  72. - asc
  73. - desc
  74. description: 排序方向
  75. -
  76. name: page
  77. in: query
  78. schema:
  79. type: integer
  80. description: 页码
  81. responses:
  82. 200:
  83. description: 成功
  84. content:
  85. application/json:
  86. schema:
  87. type: object
  88. properties:
  89. data:
  90. type: array
  91. items:
  92. type: object
  93. properties:
  94. id:
  95. type: string
  96. word:
  97. type: string
  98. tag:
  99. type: string
  100. nullable: true
  101. meaning:
  102. type: string
  103. other_meaning:
  104. type: string
  105. nullable: true
  106. language:
  107. type: string
  108. channel_id:
  109. type: string
  110. nullable: true
  111. channel:
  112. type: object
  113. properties: { id: { type: string }, name: { type: string } }
  114. nullable: true
  115. owner_id:
  116. type: string
  117. quality:
  118. type: string
  119. nullable: true
  120. content_type:
  121. type: string
  122. summary:
  123. type: string
  124. nullable: true
  125. note:
  126. type: string
  127. nullable: true
  128. redirect:
  129. type: string
  130. nullable: true
  131. categories:
  132. type: array
  133. items: { type: string }
  134. summary_text:
  135. type: string
  136. body:
  137. type: array
  138. items: { $ref: '../../main.yaml#/components/schemas/MarkupNode' }
  139. description: 仅在部分查询口径下返回。
  140. html:
  141. type: string
  142. description: 仅在部分查询口径下返回。
  143. editor:
  144. type: object
  145. properties: { id: { type: string }, nickName: { type: string }, userName: { type: string }, realName: { type: string }, sn: { type: integer }, avatar: { type: string }, roles: { type: array, items: { type: string } } }
  146. nullable: true
  147. co_editor:
  148. type: object
  149. properties: { id: { type: string }, nickName: { type: string }, userName: { type: string }, realName: { type: string }, sn: { type: integer }, avatar: { type: string }, roles: { type: array, items: { type: string } } }
  150. nullable: true
  151. etag:
  152. type: string
  153. abilities:
  154. type: object
  155. properties: { update: { type: boolean }, delete: { type: boolean } }
  156. created_at:
  157. type: string
  158. updated_at:
  159. type: string
  160. deleted_at:
  161. type: string
  162. nullable: true
  163. meta:
  164. $ref: '../../main.yaml#/components/schemas/PaginationMeta'
  165. 403:
  166. description: '私有 channel,且看不见'
  167. content:
  168. application/problem+json:
  169. schema:
  170. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  171. 422:
  172. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  173. post:
  174. summary: '在 channel 里新建术语'
  175. tags:
  176. - channels
  177. operationId: post_api_v3_channels_channel_terms
  178. description: |-
  179. 能写 channel 内容的人(含团队 editor)。owner 与语言跟 channel。同一 channel 里 word@tag 唯一(409)。
  180. 分类写在 note 的 `{{category|…}}` 里。AI 模型凭 `X-Agent-Grant` 代写。
  181. 实现:`V3\ChannelTermController@store`
  182. security:
  183. -
  184. bearerAuth: []
  185. parameters:
  186. -
  187. name: channel
  188. in: path
  189. required: true
  190. schema:
  191. type: string
  192. description: 'channel uid'
  193. requestBody:
  194. required: true
  195. content:
  196. application/json:
  197. schema:
  198. type: object
  199. properties:
  200. word:
  201. type: string
  202. description: 巴利词,建立后不能改
  203. tag:
  204. type: string
  205. nullable: true
  206. description: '义项(同词多义时区分),不能含 @,建立后不能改'
  207. meaning:
  208. type: string
  209. description: 释义
  210. other_meaning:
  211. type: string
  212. nullable: true
  213. description: 其它释义
  214. note:
  215. type: string
  216. nullable: true
  217. description: 正文
  218. summary:
  219. type: string
  220. nullable: true
  221. description: '摘要,格式与 note 相同'
  222. quality:
  223. type: string
  224. nullable: true
  225. description: 质量
  226. enum:
  227. - featured
  228. - standard
  229. - draft
  230. - pending
  231. content_type:
  232. type: string
  233. description: 正文方言
  234. enum:
  235. - markdown
  236. - markdown-e2
  237. default: markdown-e2
  238. redirect:
  239. type: string
  240. nullable: true
  241. description: '重定向到 word 或 word@tag'
  242. required:
  243. - word
  244. - meaning
  245. responses:
  246. 200:
  247. description: 成功
  248. content:
  249. application/json:
  250. schema:
  251. type: object
  252. properties:
  253. data:
  254. type: object
  255. properties:
  256. id:
  257. type: string
  258. word:
  259. type: string
  260. tag:
  261. type: string
  262. nullable: true
  263. meaning:
  264. type: string
  265. other_meaning:
  266. type: string
  267. nullable: true
  268. language:
  269. type: string
  270. channel_id:
  271. type: string
  272. nullable: true
  273. channel:
  274. type: object
  275. properties:
  276. id: { type: string }
  277. name: { type: string }
  278. nullable: true
  279. owner_id:
  280. type: string
  281. quality:
  282. type: string
  283. nullable: true
  284. content_type:
  285. type: string
  286. summary:
  287. type: string
  288. nullable: true
  289. note:
  290. type: string
  291. nullable: true
  292. redirect:
  293. type: string
  294. nullable: true
  295. categories:
  296. type: array
  297. items:
  298. type: string
  299. summary_text:
  300. type: string
  301. body:
  302. type: array
  303. items:
  304. $ref: '../../main.yaml#/components/schemas/MarkupNode'
  305. description: 仅在部分查询口径下返回。
  306. html:
  307. type: string
  308. description: 仅在部分查询口径下返回。
  309. editor:
  310. type: object
  311. properties:
  312. id: { type: string }
  313. nickName: { type: string }
  314. userName: { type: string }
  315. realName: { type: string }
  316. sn: { type: integer }
  317. avatar: { type: string }
  318. roles: { type: array, items: { type: string } }
  319. nullable: true
  320. co_editor:
  321. type: object
  322. properties:
  323. id: { type: string }
  324. nickName: { type: string }
  325. userName: { type: string }
  326. realName: { type: string }
  327. sn: { type: integer }
  328. avatar: { type: string }
  329. roles: { type: array, items: { type: string } }
  330. nullable: true
  331. etag:
  332. type: string
  333. abilities:
  334. type: object
  335. properties:
  336. update: { type: boolean }
  337. delete: { type: boolean }
  338. created_at:
  339. type: string
  340. updated_at:
  341. type: string
  342. deleted_at:
  343. type: string
  344. nullable: true
  345. 201:
  346. description: 已新建
  347. content:
  348. application/json:
  349. schema:
  350. type: object
  351. properties:
  352. data:
  353. type: object
  354. properties:
  355. id:
  356. type: string
  357. word:
  358. type: string
  359. tag:
  360. type: string
  361. nullable: true
  362. meaning:
  363. type: string
  364. other_meaning:
  365. type: string
  366. nullable: true
  367. language:
  368. type: string
  369. channel_id:
  370. type: string
  371. nullable: true
  372. channel:
  373. type: object
  374. properties:
  375. id: { type: string }
  376. name: { type: string }
  377. nullable: true
  378. owner_id:
  379. type: string
  380. quality:
  381. type: string
  382. nullable: true
  383. content_type:
  384. type: string
  385. summary:
  386. type: string
  387. nullable: true
  388. note:
  389. type: string
  390. nullable: true
  391. redirect:
  392. type: string
  393. nullable: true
  394. categories:
  395. type: array
  396. items:
  397. type: string
  398. summary_text:
  399. type: string
  400. body:
  401. type: array
  402. items:
  403. $ref: '../../main.yaml#/components/schemas/MarkupNode'
  404. description: 仅在部分查询口径下返回。
  405. html:
  406. type: string
  407. description: 仅在部分查询口径下返回。
  408. editor:
  409. type: object
  410. properties:
  411. id: { type: string }
  412. nickName: { type: string }
  413. userName: { type: string }
  414. realName: { type: string }
  415. sn: { type: integer }
  416. avatar: { type: string }
  417. roles: { type: array, items: { type: string } }
  418. nullable: true
  419. co_editor:
  420. type: object
  421. properties:
  422. id: { type: string }
  423. nickName: { type: string }
  424. userName: { type: string }
  425. realName: { type: string }
  426. sn: { type: integer }
  427. avatar: { type: string }
  428. roles: { type: array, items: { type: string } }
  429. nullable: true
  430. etag:
  431. type: string
  432. abilities:
  433. type: object
  434. properties:
  435. update: { type: boolean }
  436. delete: { type: boolean }
  437. created_at:
  438. type: string
  439. updated_at:
  440. type: string
  441. deleted_at:
  442. type: string
  443. nullable: true
  444. 401:
  445. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  446. 403:
  447. description: '不能写这个 channel'
  448. content:
  449. application/problem+json:
  450. schema:
  451. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  452. 409:
  453. description: '已有这个 word@tag'
  454. content:
  455. application/problem+json:
  456. schema:
  457. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  458. 422:
  459. $ref: '../../main.yaml#/components/responses/ProblemValidation'