v2-view.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-view.yaml
  2. get:
  3. summary: '列出 view'
  4. tags:
  5. - view
  6. operationId: get_api_v2_view
  7. description: 实现:`ViewController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - count
  16. - user-recent
  17. - user
  18. - studio
  19. -
  20. name: take
  21. in: query
  22. schema:
  23. type: string
  24. -
  25. name: name
  26. in: query
  27. schema:
  28. type: string
  29. -
  30. name: search
  31. in: query
  32. schema:
  33. type: string
  34. -
  35. name: order
  36. in: query
  37. schema:
  38. type: string
  39. default: updated_at
  40. -
  41. name: dir
  42. in: query
  43. schema:
  44. type: string
  45. default: desc
  46. -
  47. name: offset
  48. in: query
  49. schema:
  50. type: string
  51. -
  52. name: limit
  53. in: query
  54. schema:
  55. type: string
  56. responses:
  57. 200:
  58. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  59. content:
  60. application/json:
  61. schema:
  62. type: object
  63. properties:
  64. ok:
  65. type: boolean
  66. message:
  67. type: string
  68. data:
  69. type: object
  70. properties:
  71. rows:
  72. type: array
  73. items:
  74. type: object
  75. count:
  76. type: integer
  77. 401:
  78. $ref: '../../main.yaml#/components/responses/Unauthorized'
  79. 422:
  80. $ref: '../../main.yaml#/components/responses/ValidationError'
  81. post:
  82. summary: '新建 view'
  83. tags:
  84. - view
  85. operationId: post_api_v2_view
  86. description: 实现:`ViewController@store`
  87. requestBody:
  88. required: false
  89. content:
  90. application/json:
  91. schema:
  92. type: object
  93. properties:
  94. target_type:
  95. type: string
  96. enum:
  97. - chapter
  98. channel:
  99. type: string
  100. book:
  101. type: string
  102. para:
  103. type: string
  104. mode:
  105. type: string
  106. default: read
  107. responses:
  108. 200:
  109. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  110. content:
  111. application/json:
  112. schema:
  113. type: object
  114. properties:
  115. ok:
  116. type: boolean
  117. message:
  118. type: string
  119. data:
  120. type: object
  121. 401:
  122. $ref: '../../main.yaml#/components/responses/Unauthorized'
  123. 422:
  124. $ref: '../../main.yaml#/components/responses/ValidationError'