v2-sent-discussion-tree.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-sent-discussion-tree.yaml
  2. post:
  3. summary: 按句子批量查询讨论概览
  4. tags:
  5. - sent-discussion-tree
  6. operationId: post_api_v2_sent_discussion_tree
  7. description: |-
  8. 对传入的每个句子定位(book/paragraph/word_start/word_end/channel_id)先查到 sentence,
  9. 再取该句上全部顶级讨论(title、children_count、editor_uid,按创建时间倒序)。
  10. 没有讨论的句子会被跳过,不做登录与权限校验。返回 rows 与 count。
  11. 实现:`DiscussionController@discussion_tree`
  12. requestBody:
  13. required: true
  14. content:
  15. application/json:
  16. schema:
  17. type: object
  18. properties:
  19. data:
  20. type: array
  21. description: 句子定位数组
  22. 'data[].book':
  23. type: integer
  24. description: 卷号
  25. 'data[].paragraph':
  26. type: integer
  27. description: 段号
  28. 'data[].word_start':
  29. type: integer
  30. description: 句子起始词序号
  31. 'data[].word_end':
  32. type: integer
  33. description: 句子结束词序号
  34. 'data[].channel_id':
  35. type: string
  36. description: '译文集 channel uid'
  37. required:
  38. - data
  39. - 'data[].book'
  40. - 'data[].paragraph'
  41. - 'data[].word_start'
  42. - 'data[].word_end'
  43. - 'data[].channel_id'
  44. responses:
  45. 200:
  46. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  47. content:
  48. application/json:
  49. schema:
  50. type: object
  51. properties:
  52. ok:
  53. type: boolean
  54. message:
  55. type: string
  56. data:
  57. type: object
  58. 401:
  59. $ref: '../../main.yaml#/components/responses/Unauthorized'
  60. 422:
  61. $ref: '../../main.yaml#/components/responses/ValidationError'