v3-studios-studio-terms.yaml 15 KB

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