v2-discussion-discussion.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-discussion-discussion.yaml
  2. get:
  3. summary: 查询单条讨论
  4. tags:
  5. - discussion
  6. operationId: get_api_v2_discussion_discussion_
  7. description: |
  8. 已被 `GET /v3/discussions/{discussion}` 取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
  9. parameters:
  10. -
  11. name: discussion
  12. in: path
  13. required: true
  14. schema:
  15. type: string
  16. description: '讨论 id'
  17. responses:
  18. 200:
  19. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  20. content:
  21. application/json:
  22. schema:
  23. type: object
  24. properties:
  25. ok:
  26. type: boolean
  27. message:
  28. type: string
  29. data:
  30. type: object
  31. properties:
  32. id:
  33. type: integer
  34. title:
  35. type: string
  36. content:
  37. type: string
  38. content_type:
  39. type: string
  40. parent:
  41. type: string
  42. status:
  43. type: integer
  44. editor:
  45. type: string
  46. res_id:
  47. type: integer
  48. res_type:
  49. type: string
  50. type:
  51. type: integer
  52. tpl_id:
  53. type: integer
  54. children_count:
  55. type: integer
  56. created_at:
  57. type: string
  58. updated_at:
  59. type: string
  60. pos_start:
  61. type: string
  62. pos_end:
  63. type: string
  64. quote_exact:
  65. type: string
  66. quote_prefix:
  67. type: string
  68. quote_suffix:
  69. type: string
  70. html:
  71. type: string
  72. summary:
  73. type: string
  74. 401:
  75. $ref: '../../main.yaml#/components/responses/Unauthorized'
  76. 422:
  77. $ref: '../../main.yaml#/components/responses/ValidationError'
  78. deprecated: true
  79. put:
  80. summary: '修改讨论 / 批注'
  81. tags:
  82. - discussion
  83. operationId: put_api_v2_discussion_discussion_
  84. description: |
  85. 已被 `PATCH /v3/discussions/{discussion}`(局部更新)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
  86. parameters:
  87. -
  88. name: discussion
  89. in: path
  90. required: true
  91. schema:
  92. type: string
  93. description: '讨论 id'
  94. requestBody:
  95. required: false
  96. content:
  97. application/json:
  98. schema:
  99. type: object
  100. properties:
  101. title:
  102. type: string
  103. description: 标题,未提交会被清空
  104. content:
  105. type: string
  106. description: 正文内容,未提交会被清空
  107. status:
  108. type: string
  109. description: '状态,未提交会重置为 active'
  110. enum:
  111. - active
  112. - close
  113. default: active
  114. type:
  115. type: string
  116. description: 讨论类型,仅在提交时更新
  117. enum:
  118. - discussion
  119. - qa
  120. - help
  121. - note
  122. - commentary
  123. pos_start:
  124. type: integer
  125. description: 锚点起始偏移,仅在提交时更新
  126. pos_end:
  127. type: integer
  128. description: 锚点结束偏移,仅在提交时更新
  129. quote_exact:
  130. type: string
  131. description: 锚定的原文片段,仅在提交时更新
  132. quote_prefix:
  133. type: string
  134. description: 锚定片段前的上下文,仅在提交时更新
  135. quote_suffix:
  136. type: string
  137. description: 锚定片段后的上下文,仅在提交时更新
  138. responses:
  139. 200:
  140. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  141. content:
  142. application/json:
  143. schema:
  144. type: object
  145. properties:
  146. ok:
  147. type: boolean
  148. message:
  149. type: string
  150. data:
  151. type: object
  152. properties:
  153. id:
  154. type: integer
  155. title:
  156. type: string
  157. content:
  158. type: string
  159. content_type:
  160. type: string
  161. parent:
  162. type: string
  163. status:
  164. type: integer
  165. editor:
  166. type: string
  167. res_id:
  168. type: integer
  169. res_type:
  170. type: string
  171. type:
  172. type: integer
  173. tpl_id:
  174. type: integer
  175. children_count:
  176. type: integer
  177. created_at:
  178. type: string
  179. updated_at:
  180. type: string
  181. pos_start:
  182. type: string
  183. pos_end:
  184. type: string
  185. quote_exact:
  186. type: string
  187. quote_prefix:
  188. type: string
  189. quote_suffix:
  190. type: string
  191. html:
  192. type: string
  193. summary:
  194. type: string
  195. 401:
  196. $ref: '../../main.yaml#/components/responses/Unauthorized'
  197. 422:
  198. $ref: '../../main.yaml#/components/responses/ValidationError'
  199. deprecated: true
  200. patch:
  201. summary: '修改讨论 / 批注'
  202. tags:
  203. - discussion
  204. operationId: patch_api_v2_discussion_discussion_
  205. description: |
  206. 已被 `PATCH /v3/discussions/{discussion}`(局部更新)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
  207. parameters:
  208. -
  209. name: discussion
  210. in: path
  211. required: true
  212. schema:
  213. type: string
  214. description: '讨论 id'
  215. requestBody:
  216. required: false
  217. content:
  218. application/json:
  219. schema:
  220. type: object
  221. properties:
  222. title:
  223. type: string
  224. description: 标题,未提交会被清空
  225. content:
  226. type: string
  227. description: 正文内容,未提交会被清空
  228. status:
  229. type: string
  230. description: '状态,未提交会重置为 active'
  231. enum:
  232. - active
  233. - close
  234. default: active
  235. type:
  236. type: string
  237. description: 讨论类型,仅在提交时更新
  238. enum:
  239. - discussion
  240. - qa
  241. - help
  242. - note
  243. - commentary
  244. pos_start:
  245. type: integer
  246. description: 锚点起始偏移,仅在提交时更新
  247. pos_end:
  248. type: integer
  249. description: 锚点结束偏移,仅在提交时更新
  250. quote_exact:
  251. type: string
  252. description: 锚定的原文片段,仅在提交时更新
  253. quote_prefix:
  254. type: string
  255. description: 锚定片段前的上下文,仅在提交时更新
  256. quote_suffix:
  257. type: string
  258. description: 锚定片段后的上下文,仅在提交时更新
  259. responses:
  260. 200:
  261. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  262. content:
  263. application/json:
  264. schema:
  265. type: object
  266. properties:
  267. ok:
  268. type: boolean
  269. message:
  270. type: string
  271. data:
  272. type: object
  273. properties:
  274. id:
  275. type: integer
  276. title:
  277. type: string
  278. content:
  279. type: string
  280. content_type:
  281. type: string
  282. parent:
  283. type: string
  284. status:
  285. type: integer
  286. editor:
  287. type: string
  288. res_id:
  289. type: integer
  290. res_type:
  291. type: string
  292. type:
  293. type: integer
  294. tpl_id:
  295. type: integer
  296. children_count:
  297. type: integer
  298. created_at:
  299. type: string
  300. updated_at:
  301. type: string
  302. pos_start:
  303. type: string
  304. pos_end:
  305. type: string
  306. quote_exact:
  307. type: string
  308. quote_prefix:
  309. type: string
  310. quote_suffix:
  311. type: string
  312. html:
  313. type: string
  314. summary:
  315. type: string
  316. 401:
  317. $ref: '../../main.yaml#/components/responses/Unauthorized'
  318. 422:
  319. $ref: '../../main.yaml#/components/responses/ValidationError'
  320. deprecated: true
  321. delete:
  322. summary: '删除讨论 / 批注'
  323. tags:
  324. - discussion
  325. operationId: delete_api_v2_discussion_discussion_
  326. description: |
  327. 已被 `DELETE /v3/discussions/{discussion}` 取代。2026-10-15 起两边都是软删除。
  328. 保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
  329. parameters:
  330. -
  331. name: discussion
  332. in: path
  333. required: true
  334. schema:
  335. type: string
  336. description: '讨论 id'
  337. responses:
  338. 200:
  339. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  340. content:
  341. application/json:
  342. schema:
  343. type: object
  344. properties:
  345. ok:
  346. type: boolean
  347. message:
  348. type: string
  349. data:
  350. type: object
  351. 401:
  352. $ref: '../../main.yaml#/components/responses/Unauthorized'
  353. 422:
  354. $ref: '../../main.yaml#/components/responses/ValidationError'
  355. deprecated: true