v3-discussions-discussion-replies.yaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-discussions-discussion-replies.yaml
  2. get:
  3. summary: 列出话题的回复
  4. tags:
  5. - discussions
  6. operationId: get_api_v3_discussions_discussion_replies
  7. description: |-
  8. 按时间正序。删除了的话题(墓碑)下的回复照样可读。
  9. 实现:`V3\DiscussionReplyController@index`
  10. security:
  11. - { }
  12. -
  13. bearerAuth: []
  14. parameters:
  15. -
  16. name: discussion
  17. in: path
  18. required: true
  19. schema:
  20. type: string
  21. description: '话题的 uuid'
  22. -
  23. name: per_page
  24. in: query
  25. schema:
  26. type: integer
  27. default: 50
  28. description: '每页数量,最大 200'
  29. -
  30. name: page
  31. in: query
  32. schema:
  33. type: integer
  34. default: 1
  35. description: 页码
  36. responses:
  37. 200:
  38. description: 成功
  39. content:
  40. application/json:
  41. schema:
  42. type: object
  43. properties:
  44. data:
  45. type: array
  46. items:
  47. type: object
  48. properties:
  49. id:
  50. type: string
  51. target_type:
  52. type: string
  53. target_id:
  54. type: string
  55. parent_id:
  56. type: string
  57. nullable: true
  58. type:
  59. type: string
  60. severity:
  61. type: string
  62. nullable: true
  63. status:
  64. type: string
  65. title:
  66. type: string
  67. nullable: true
  68. content:
  69. type: string
  70. nullable: true
  71. content_type:
  72. type: string
  73. html:
  74. type: string
  75. description: 仅在部分查询口径下返回。
  76. summary:
  77. type: string
  78. description: 仅在部分查询口径下返回。
  79. tpl_id:
  80. type: string
  81. nullable: true
  82. pos_start:
  83. type: integer
  84. nullable: true
  85. pos_end:
  86. type: integer
  87. nullable: true
  88. quote_exact:
  89. type: string
  90. nullable: true
  91. quote_prefix:
  92. type: string
  93. nullable: true
  94. quote_suffix:
  95. type: string
  96. nullable: true
  97. reply_count:
  98. type: integer
  99. description: 仅在部分查询口径下返回。
  100. editor:
  101. type: object
  102. 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 } } }
  103. nullable: true
  104. co_editor:
  105. type: object
  106. 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 } } }
  107. nullable: true
  108. abilities:
  109. type: object
  110. properties: { update: { type: boolean }, delete: { type: boolean }, close: { type: boolean }, reply: { type: boolean } }
  111. created_at:
  112. type: string
  113. updated_at:
  114. type: string
  115. deleted_at:
  116. type: string
  117. nullable: true
  118. meta:
  119. $ref: '../../main.yaml#/components/schemas/PaginationMeta'
  120. 422:
  121. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  122. post:
  123. summary: 回复话题
  124. tags:
  125. - discussions
  126. operationId: post_api_v3_discussions_discussion_replies
  127. description: |-
  128. 类型与挂靠对象继承话题。已关闭的话题不能回复(409),对一条回复再回复 422。
  129. AI 代写同 `POST /v3/discussions`(`X-Agent-Grant` 请求头)。
  130. 文章上的 qa 只有文章的编辑者能回答。默认发通知,`notify=false` 关闭。
  131. 实现:`V3\DiscussionReplyController@store`
  132. security:
  133. -
  134. bearerAuth: []
  135. parameters:
  136. -
  137. name: discussion
  138. in: path
  139. required: true
  140. schema:
  141. type: string
  142. description: '话题的 uuid'
  143. requestBody:
  144. required: true
  145. content:
  146. application/json:
  147. schema:
  148. type: object
  149. properties:
  150. content:
  151. type: string
  152. description: 正文(markdown)
  153. notify:
  154. type: boolean
  155. description: 是否发通知
  156. default: true
  157. required:
  158. - content
  159. responses:
  160. 200:
  161. description: 成功
  162. content:
  163. application/json:
  164. schema:
  165. type: object
  166. properties:
  167. data:
  168. type: object
  169. properties:
  170. id:
  171. type: string
  172. target_type:
  173. type: string
  174. target_id:
  175. type: string
  176. parent_id:
  177. type: string
  178. nullable: true
  179. type:
  180. type: string
  181. severity:
  182. type: string
  183. nullable: true
  184. status:
  185. type: string
  186. title:
  187. type: string
  188. nullable: true
  189. content:
  190. type: string
  191. nullable: true
  192. content_type:
  193. type: string
  194. html:
  195. type: string
  196. description: 仅在部分查询口径下返回。
  197. summary:
  198. type: string
  199. description: 仅在部分查询口径下返回。
  200. tpl_id:
  201. type: string
  202. nullable: true
  203. pos_start:
  204. type: integer
  205. nullable: true
  206. pos_end:
  207. type: integer
  208. nullable: true
  209. quote_exact:
  210. type: string
  211. nullable: true
  212. quote_prefix:
  213. type: string
  214. nullable: true
  215. quote_suffix:
  216. type: string
  217. nullable: true
  218. reply_count:
  219. type: integer
  220. description: 仅在部分查询口径下返回。
  221. editor:
  222. type: object
  223. properties:
  224. id: { type: string }
  225. nickName: { type: string }
  226. userName: { type: string }
  227. realName: { type: string }
  228. sn: { type: integer }
  229. avatar: { type: string }
  230. roles: { type: array, items: { type: string } }
  231. nullable: true
  232. co_editor:
  233. type: object
  234. properties:
  235. id: { type: string }
  236. nickName: { type: string }
  237. userName: { type: string }
  238. realName: { type: string }
  239. sn: { type: integer }
  240. avatar: { type: string }
  241. roles: { type: array, items: { type: string } }
  242. nullable: true
  243. abilities:
  244. type: object
  245. properties:
  246. update: { type: boolean }
  247. delete: { type: boolean }
  248. close: { type: boolean }
  249. reply: { type: boolean }
  250. created_at:
  251. type: string
  252. updated_at:
  253. type: string
  254. deleted_at:
  255. type: string
  256. nullable: true
  257. 201:
  258. description: 回复成功
  259. content:
  260. application/json:
  261. schema:
  262. type: object
  263. properties:
  264. data:
  265. type: object
  266. properties:
  267. id:
  268. type: string
  269. target_type:
  270. type: string
  271. target_id:
  272. type: string
  273. parent_id:
  274. type: string
  275. nullable: true
  276. type:
  277. type: string
  278. severity:
  279. type: string
  280. nullable: true
  281. status:
  282. type: string
  283. title:
  284. type: string
  285. nullable: true
  286. content:
  287. type: string
  288. nullable: true
  289. content_type:
  290. type: string
  291. html:
  292. type: string
  293. description: 仅在部分查询口径下返回。
  294. summary:
  295. type: string
  296. description: 仅在部分查询口径下返回。
  297. tpl_id:
  298. type: string
  299. nullable: true
  300. pos_start:
  301. type: integer
  302. nullable: true
  303. pos_end:
  304. type: integer
  305. nullable: true
  306. quote_exact:
  307. type: string
  308. nullable: true
  309. quote_prefix:
  310. type: string
  311. nullable: true
  312. quote_suffix:
  313. type: string
  314. nullable: true
  315. reply_count:
  316. type: integer
  317. description: 仅在部分查询口径下返回。
  318. editor:
  319. type: object
  320. properties:
  321. id: { type: string }
  322. nickName: { type: string }
  323. userName: { type: string }
  324. realName: { type: string }
  325. sn: { type: integer }
  326. avatar: { type: string }
  327. roles: { type: array, items: { type: string } }
  328. nullable: true
  329. co_editor:
  330. type: object
  331. properties:
  332. id: { type: string }
  333. nickName: { type: string }
  334. userName: { type: string }
  335. realName: { type: string }
  336. sn: { type: integer }
  337. avatar: { type: string }
  338. roles: { type: array, items: { type: string } }
  339. nullable: true
  340. abilities:
  341. type: object
  342. properties:
  343. update: { type: boolean }
  344. delete: { type: boolean }
  345. close: { type: boolean }
  346. reply: { type: boolean }
  347. created_at:
  348. type: string
  349. updated_at:
  350. type: string
  351. deleted_at:
  352. type: string
  353. nullable: true
  354. 401:
  355. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  356. 403:
  357. description: 当前用户不能回复这个话题
  358. content:
  359. application/problem+json:
  360. schema:
  361. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  362. 409:
  363. description: 话题已关闭
  364. content:
  365. application/problem+json:
  366. schema:
  367. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  368. 422:
  369. $ref: '../../main.yaml#/components/responses/ProblemValidation'