v2-webhook.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-webhook.yaml
  2. get:
  3. summary: '列出 webhook'
  4. tags:
  5. - webhook
  6. operationId: get_api_v2_webhook
  7. description: 实现:`WebHookController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - channel
  16. -
  17. name: id
  18. in: query
  19. schema:
  20. type: string
  21. -
  22. name: order
  23. in: query
  24. schema:
  25. type: string
  26. default: updated_at
  27. -
  28. name: dir
  29. in: query
  30. schema:
  31. type: string
  32. default: desc
  33. -
  34. name: offset
  35. in: query
  36. schema:
  37. type: string
  38. -
  39. name: limit
  40. in: query
  41. schema:
  42. type: string
  43. -
  44. name: search
  45. in: query
  46. description: 搜索关键字
  47. schema:
  48. type: string
  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. properties: { id: { type: integer }, res_type: { type: string }, res_id: { type: integer }, url: { type: string }, receiver: { type: string }, event: { type: string }, status: { type: integer }, fail: { type: string }, success: { type: string }, created_at: { type: string }, updated_at: { type: string } }
  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: '新建 webhook'
  77. tags:
  78. - webhook
  79. operationId: post_api_v2_webhook
  80. description: 实现:`WebHookController@store`
  81. requestBody:
  82. required: true
  83. content:
  84. application/json:
  85. schema:
  86. type: object
  87. properties:
  88. res_type:
  89. type: string
  90. description: 规则:required
  91. res_id:
  92. type: string
  93. description: 规则:required
  94. url:
  95. type: string
  96. description: 规则:required
  97. receiver:
  98. type: string
  99. description: 规则:required
  100. event:
  101. type: string
  102. status:
  103. type: string
  104. default: active
  105. required:
  106. - res_type
  107. - res_id
  108. - url
  109. - receiver
  110. responses:
  111. 200:
  112. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  113. content:
  114. application/json:
  115. schema:
  116. type: object
  117. properties:
  118. ok:
  119. type: boolean
  120. message:
  121. type: string
  122. data:
  123. type: object
  124. properties:
  125. id:
  126. type: integer
  127. res_type:
  128. type: string
  129. res_id:
  130. type: integer
  131. url:
  132. type: string
  133. receiver:
  134. type: string
  135. event:
  136. type: string
  137. status:
  138. type: integer
  139. fail:
  140. type: string
  141. success:
  142. type: string
  143. created_at:
  144. type: string
  145. updated_at:
  146. type: string
  147. 401:
  148. $ref: '../../main.yaml#/components/responses/Unauthorized'
  149. 422:
  150. $ref: '../../main.yaml#/components/responses/ValidationError'