v2-vocabulary.yaml 2.6 KB

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