v2-like.yaml 2.9 KB

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