v2-compound.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-compound.yaml
  2. get:
  3. summary: '列出 compound'
  4. tags:
  5. - compound
  6. operationId: get_api_v2_compound
  7. description: 实现:`CompoundController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - only-word
  16. -
  17. name: search
  18. in: query
  19. description: 搜索关键字
  20. schema:
  21. type: string
  22. -
  23. name: order
  24. in: query
  25. description: 排序字段
  26. schema:
  27. type: string
  28. -
  29. name: dir
  30. in: query
  31. description: 排序方向
  32. schema:
  33. type: string
  34. enum:
  35. - desc
  36. - asc
  37. -
  38. name: limit
  39. in: query
  40. description: 每页记录数
  41. schema:
  42. type: number
  43. -
  44. name: offset
  45. in: query
  46. description: 从第几条记录开始提取
  47. schema:
  48. type: number
  49. responses:
  50. 200:
  51. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  52. content:
  53. application/json:
  54. schema:
  55. type: object
  56. properties:
  57. ok:
  58. type: boolean
  59. message:
  60. type: string
  61. data:
  62. type: object
  63. properties:
  64. rows:
  65. type: array
  66. items:
  67. type: object
  68. count:
  69. type: integer
  70. 401:
  71. $ref: '../../main.yaml#/components/responses/Unauthorized'
  72. 422:
  73. $ref: '../../main.yaml#/components/responses/ValidationError'
  74. post:
  75. summary: '新建 compound'
  76. tags:
  77. - compound
  78. operationId: post_api_v2_compound
  79. description: 实现:`CompoundController@store`
  80. requestBody:
  81. required: false
  82. content:
  83. application/json:
  84. schema:
  85. type: object
  86. properties:
  87. index:
  88. type: string
  89. words:
  90. type: string
  91. responses:
  92. 200:
  93. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  94. content:
  95. application/json:
  96. schema:
  97. type: object
  98. properties:
  99. ok:
  100. type: boolean
  101. message:
  102. type: string
  103. data:
  104. type: object
  105. 401:
  106. $ref: '../../main.yaml#/components/responses/Unauthorized'
  107. 422:
  108. $ref: '../../main.yaml#/components/responses/ValidationError'