v2-search.yaml 2.6 KB

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