v2-relation.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-relation.yaml
  2. get:
  3. summary: 'Supports optional filters: case, search, name, from, to, match, category.'
  4. tags:
  5. - relation
  6. operationId: get_api_v2_relation
  7. description: |-
  8. When the `vocabulary` parameter is present, returns the full unfiltered
  9. list from cache (suitable for populating UI dropdowns / autocomplete).
  10. 实现:`RelationController@index`
  11. parameters:
  12. -
  13. name: vocabulary
  14. in: query
  15. schema:
  16. type: boolean
  17. -
  18. name: search
  19. in: query
  20. description: 搜索关键字
  21. schema:
  22. type: string
  23. -
  24. name: order
  25. in: query
  26. description: 排序字段
  27. schema:
  28. type: string
  29. -
  30. name: dir
  31. in: query
  32. description: 排序方向
  33. schema:
  34. type: string
  35. enum:
  36. - desc
  37. - asc
  38. -
  39. name: limit
  40. in: query
  41. description: 每页记录数
  42. schema:
  43. type: number
  44. -
  45. name: offset
  46. in: query
  47. description: 从第几条记录开始提取
  48. schema:
  49. type: number
  50. responses:
  51. 200:
  52. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  53. content:
  54. application/json:
  55. schema:
  56. type: object
  57. properties:
  58. ok:
  59. type: boolean
  60. message:
  61. type: string
  62. data:
  63. type: object
  64. properties:
  65. rows:
  66. type: array
  67. items:
  68. type: object
  69. count:
  70. type: integer
  71. 401:
  72. $ref: '../../main.yaml#/components/responses/Unauthorized'
  73. 422:
  74. $ref: '../../main.yaml#/components/responses/ValidationError'
  75. post:
  76. summary: 'Requires authentication. Invalidates the vocabulary cache on success.'
  77. tags:
  78. - relation
  79. operationId: post_api_v2_relation
  80. description: 实现:`RelationController@store`
  81. requestBody:
  82. required: true
  83. content:
  84. application/json:
  85. schema:
  86. type: object
  87. properties:
  88. name:
  89. type: string
  90. description: 规则:required
  91. case:
  92. type: string
  93. category:
  94. type: string
  95. required:
  96. - name
  97. responses:
  98. 200:
  99. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  100. content:
  101. application/json:
  102. schema:
  103. type: object
  104. properties:
  105. ok:
  106. type: boolean
  107. message:
  108. type: string
  109. data:
  110. type: object
  111. properties:
  112. id:
  113. type: integer
  114. name:
  115. type: string
  116. case:
  117. type: string
  118. from:
  119. type: string
  120. to:
  121. type: string
  122. match:
  123. type: string
  124. category:
  125. type: string
  126. created_at:
  127. type: string
  128. updated_at:
  129. type: string
  130. editor:
  131. type: string
  132. category_channel:
  133. type: string
  134. channelId:
  135. type: string
  136. word:
  137. type: string
  138. meaning:
  139. type: string
  140. name_channel:
  141. type: string
  142. 401:
  143. $ref: '../../main.yaml#/components/responses/Unauthorized'
  144. 422:
  145. $ref: '../../main.yaml#/components/responses/ValidationError'