v2-sentence.yaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-sentence.yaml
  2. get:
  3. summary: '列出 sentence'
  4. tags:
  5. - sentence
  6. operationId: get_api_v2_sentence
  7. description: 实现:`SentenceController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - public
  16. - fulltext
  17. - channel
  18. - sent-can-read
  19. - chapter
  20. - paragraph
  21. - my-edit
  22. -
  23. name: channel_type
  24. in: query
  25. schema:
  26. type: string
  27. default: translation
  28. -
  29. name: updated_after
  30. in: query
  31. schema:
  32. type: string
  33. default: '1970-1-1'
  34. -
  35. name: key
  36. in: query
  37. schema:
  38. type: string
  39. -
  40. name: sentence
  41. in: query
  42. schema:
  43. type: string
  44. -
  45. name: channel
  46. in: query
  47. schema:
  48. type: string
  49. -
  50. name: type
  51. in: query
  52. schema:
  53. type: string
  54. default: translation
  55. -
  56. name: excludes
  57. in: query
  58. schema:
  59. type: string
  60. -
  61. name: book
  62. in: query
  63. schema:
  64. type: string
  65. -
  66. name: para
  67. in: query
  68. schema:
  69. type: string
  70. -
  71. name: channels
  72. in: query
  73. schema:
  74. type: string
  75. -
  76. name: lang
  77. in: query
  78. schema:
  79. type: string
  80. -
  81. name: strlen
  82. in: query
  83. schema:
  84. type: string
  85. -
  86. name: order
  87. in: query
  88. schema:
  89. type: string
  90. default: updated_at
  91. -
  92. name: dir
  93. in: query
  94. schema:
  95. type: string
  96. default: desc
  97. -
  98. name: offset
  99. in: query
  100. schema:
  101. type: string
  102. -
  103. name: limit
  104. in: query
  105. schema:
  106. type: string
  107. -
  108. name: search
  109. in: query
  110. description: 搜索关键字
  111. schema:
  112. type: string
  113. responses:
  114. 200:
  115. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  116. content:
  117. application/json:
  118. schema:
  119. type: object
  120. properties:
  121. ok:
  122. type: boolean
  123. message:
  124. type: string
  125. data:
  126. type: object
  127. properties:
  128. rows:
  129. type: array
  130. items:
  131. type: object
  132. properties: { data: { type: string }, uid: { type: string }, id: { type: integer }, content: { type: string }, content_type: { type: string }, html: { type: string }, book: { type: string }, paragraph: { type: string }, word_start: { type: string }, word_end: { type: string }, editor: { type: string }, fork_at: { type: string }, updated_at: { type: string }, channel: { type: string }, studio: { type: string }, suggestionCount: { type: string }, acceptor: { type: string }, pr_edit_at: { type: string } }
  133. count:
  134. type: integer
  135. 401:
  136. $ref: '../../main.yaml#/components/responses/Unauthorized'
  137. 422:
  138. $ref: '../../main.yaml#/components/responses/ValidationError'
  139. post:
  140. summary: 新建多个句子
  141. tags:
  142. - sentence
  143. operationId: post_api_v2_sentence
  144. description: |-
  145. 如果句子存在,修改
  146. 实现:`SentenceController@store`
  147. requestBody:
  148. required: false
  149. content:
  150. application/json:
  151. schema:
  152. type: object
  153. properties:
  154. sentences:
  155. type: string
  156. channel:
  157. type: string
  158. book:
  159. type: string
  160. access_token:
  161. type: string
  162. copy:
  163. type: string
  164. fork_from:
  165. type: string
  166. responses:
  167. 200:
  168. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  169. content:
  170. application/json:
  171. schema:
  172. type: object
  173. properties:
  174. ok:
  175. type: boolean
  176. message:
  177. type: string
  178. data:
  179. type: object
  180. properties:
  181. data:
  182. type: string
  183. uid:
  184. type: string
  185. id:
  186. type: integer
  187. content:
  188. type: string
  189. content_type:
  190. type: string
  191. html:
  192. type: string
  193. book:
  194. type: string
  195. paragraph:
  196. type: string
  197. word_start:
  198. type: string
  199. word_end:
  200. type: string
  201. editor:
  202. type: string
  203. fork_at:
  204. type: string
  205. updated_at:
  206. type: string
  207. channel:
  208. type: string
  209. studio:
  210. type: string
  211. suggestionCount:
  212. type: string
  213. acceptor:
  214. type: string
  215. pr_edit_at:
  216. type: string
  217. 401:
  218. $ref: '../../main.yaml#/components/responses/Unauthorized'
  219. 422:
  220. $ref: '../../main.yaml#/components/responses/ValidationError'