v2-notification.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-notification.yaml
  2. get:
  3. summary: '列出 notification'
  4. tags:
  5. - notification
  6. operationId: get_api_v2_notification
  7. description: 实现:`NotificationController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - to
  16. -
  17. name: status
  18. in: query
  19. schema:
  20. type: string
  21. -
  22. name: order
  23. in: query
  24. schema:
  25. type: string
  26. default: created_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 }, from: { type: string }, to: { type: string }, url: { type: string }, content: { type: string }, content_type: { type: string }, res_type: { type: string }, res_id: { type: integer }, status: { type: integer }, created_at: { type: string }, updated_at: { type: string }, 'pr data': { type: string }, channel: { type: string }, title: { type: string }, book_title: { 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: '新建 notification'
  77. tags:
  78. - notification
  79. operationId: post_api_v2_notification
  80. description: 实现:`NotificationController@store`
  81. requestBody:
  82. required: false
  83. content:
  84. application/json:
  85. schema:
  86. type: object
  87. properties:
  88. to:
  89. type: string
  90. url:
  91. type: string
  92. content:
  93. type: string
  94. res_type:
  95. type: string
  96. res_id:
  97. type: string
  98. channel:
  99. type: string
  100. responses:
  101. 200:
  102. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  103. content:
  104. application/json:
  105. schema:
  106. type: object
  107. properties:
  108. ok:
  109. type: boolean
  110. message:
  111. type: string
  112. data:
  113. type: object
  114. properties:
  115. id:
  116. type: integer
  117. from:
  118. type: string
  119. to:
  120. type: string
  121. url:
  122. type: string
  123. content:
  124. type: string
  125. content_type:
  126. type: string
  127. res_type:
  128. type: string
  129. res_id:
  130. type: integer
  131. status:
  132. type: integer
  133. created_at:
  134. type: string
  135. updated_at:
  136. type: string
  137. 'pr data':
  138. type: string
  139. channel:
  140. type: string
  141. title:
  142. type: string
  143. book_title:
  144. type: string
  145. 401:
  146. $ref: '../../main.yaml#/components/responses/Unauthorized'
  147. 422:
  148. $ref: '../../main.yaml#/components/responses/ValidationError'