v2-chapter.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-chapter.yaml
  2. get:
  3. summary: '列出 chapter'
  4. tags:
  5. - chapter
  6. operationId: get_api_v2_chapter
  7. description: 实现:`ChapterController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - toc
  16. -
  17. name: book
  18. in: query
  19. schema:
  20. type: string
  21. -
  22. name: para
  23. in: query
  24. schema:
  25. type: string
  26. -
  27. name: order
  28. in: query
  29. schema:
  30. type: string
  31. default: paragraph
  32. -
  33. name: dir
  34. in: query
  35. schema:
  36. type: string
  37. default: asc
  38. -
  39. name: offset
  40. in: query
  41. schema:
  42. type: string
  43. -
  44. name: limit
  45. in: query
  46. schema:
  47. type: string
  48. -
  49. name: search
  50. in: query
  51. description: 搜索关键字
  52. schema:
  53. type: string
  54. responses:
  55. 200:
  56. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  57. content:
  58. application/json:
  59. schema:
  60. type: object
  61. properties:
  62. ok:
  63. type: boolean
  64. message:
  65. type: string
  66. data:
  67. type: object
  68. properties:
  69. rows:
  70. type: array
  71. items:
  72. type: object
  73. properties: { book: { type: integer }, paragraph: { type: integer }, level: { type: integer }, text: { type: string, nullable: true }, chapter_len: { type: integer }, chapter_strlen: { type: integer }, parent: { type: integer } }
  74. count:
  75. type: integer
  76. 401:
  77. $ref: '../../main.yaml#/components/responses/Unauthorized'
  78. 422:
  79. $ref: '../../main.yaml#/components/responses/ValidationError'
  80. post:
  81. summary: '新建 chapter'
  82. tags:
  83. - chapter
  84. operationId: post_api_v2_chapter
  85. description: 实现:`ChapterController@store`
  86. responses:
  87. 200:
  88. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  89. content:
  90. application/json:
  91. schema:
  92. type: object
  93. properties:
  94. ok:
  95. type: boolean
  96. message:
  97. type: string
  98. data:
  99. type: object
  100. 401:
  101. $ref: '../../main.yaml#/components/responses/Unauthorized'
  102. 422:
  103. $ref: '../../main.yaml#/components/responses/ValidationError'