v3-progress.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-progress.yaml
  2. get:
  3. summary: 列出章节翻译进度
  4. tags:
  5. - progress
  6. operationId: get_api_v3_progress
  7. description: |-
  8. 按 channel 查询各章节的翻译完成度。分页与 meta 全由框架算。
  9. 原来有个 `view` 参数,但它只有 `channel` 一个合法值、传别的直接 422——
  10. 那不是业务路径开关而是噪音,已去掉(硬规范第 1 条)。
  11. 实现:`V3\ProgressController@index`
  12. parameters:
  13. -
  14. name: channels
  15. in: query
  16. schema:
  17. type: string
  18. description: 'channel uid 列表,**下划线分隔**(不是逗号)'
  19. required: true
  20. -
  21. name: level
  22. in: query
  23. schema:
  24. type: integer
  25. description: '只返回该层级及以上的章节,需联查 pali_texts'
  26. -
  27. name: lang
  28. in: query
  29. schema:
  30. type: string
  31. description: 按译文语言过滤
  32. example: zh-Hans
  33. -
  34. name: book
  35. in: query
  36. schema:
  37. type: integer
  38. description: '按典籍 id 过滤'
  39. -
  40. name: order
  41. in: query
  42. schema:
  43. type: string
  44. enum:
  45. - book
  46. - para
  47. - lang
  48. - progress
  49. - title
  50. - last_chapter_completed_at
  51. - completed_at
  52. - updated_at
  53. default: completed_at
  54. description: 排序字段,白名单内
  55. -
  56. name: dir
  57. in: query
  58. schema:
  59. type: string
  60. enum:
  61. - asc
  62. - desc
  63. default: desc
  64. description: 排序方向
  65. -
  66. name: page
  67. in: query
  68. schema:
  69. type: integer
  70. default: 1
  71. description: 页码
  72. -
  73. name: per_page
  74. in: query
  75. schema:
  76. type: integer
  77. default: 10
  78. description: '每页数量,最大 200'
  79. responses:
  80. 200:
  81. description: 成功
  82. content:
  83. application/json:
  84. schema:
  85. type: object
  86. properties:
  87. data:
  88. type: array
  89. items:
  90. type: object
  91. properties:
  92. book:
  93. type: integer
  94. para:
  95. type: integer
  96. lang:
  97. type: string
  98. progress:
  99. type: number
  100. channel_id:
  101. type: string
  102. title:
  103. type: string
  104. nullable: true
  105. last_chapter_completed_at:
  106. type: string
  107. nullable: true
  108. completed_at:
  109. type: string
  110. nullable: true
  111. updated_at:
  112. type: string
  113. meta:
  114. $ref: '../../main.yaml#/components/schemas/PaginationMeta'
  115. 422:
  116. $ref: '../../main.yaml#/components/responses/ProblemValidation'