v2-chats.yaml 2.8 KB

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