v2-recent.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-recent.yaml
  2. get:
  3. summary: '列出 recent'
  4. tags:
  5. - recent
  6. operationId: get_api_v2_recent
  7. description: |-
  8. 按用户拉取阅读记录,view 目前只有 user 一种口径。
  9. 实现:`RecentController@index`
  10. parameters:
  11. -
  12. name: id
  13. in: query
  14. schema:
  15. type: string
  16. description: 'view=user 时的用户 uid,必须是 uuid'
  17. -
  18. name: type
  19. in: query
  20. schema:
  21. type: string
  22. description: 按记录类型过滤
  23. example: chapter
  24. -
  25. name: order
  26. in: query
  27. schema:
  28. type: string
  29. default: updated_at
  30. -
  31. name: dir
  32. in: query
  33. schema:
  34. type: string
  35. default: desc
  36. -
  37. name: offset
  38. in: query
  39. schema:
  40. type: string
  41. -
  42. name: limit
  43. in: query
  44. schema:
  45. type: string
  46. -
  47. name: view
  48. in: query
  49. schema:
  50. type: string
  51. enum:
  52. - user
  53. description: 查询口径
  54. required: true
  55. -
  56. name: search
  57. in: query
  58. description: 搜索关键字
  59. schema:
  60. type: string
  61. responses:
  62. 200:
  63. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  64. content:
  65. application/json:
  66. schema:
  67. type: object
  68. properties:
  69. ok:
  70. type: boolean
  71. message:
  72. type: string
  73. data:
  74. type: object
  75. properties:
  76. rows:
  77. type: array
  78. items:
  79. type: object
  80. properties: { id: { type: string }, type: { type: string }, article_id: { type: string }, param: { type: string, nullable: true }, updated_at: { type: string }, title: { type: string } }
  81. count:
  82. type: integer
  83. 401:
  84. $ref: '../../main.yaml#/components/responses/Unauthorized'
  85. 422:
  86. $ref: '../../main.yaml#/components/responses/ValidationError'
  87. post:
  88. summary: '新建 recent'
  89. tags:
  90. - recent
  91. operationId: post_api_v2_recent
  92. description: 实现:`RecentController@store`
  93. requestBody:
  94. required: true
  95. content:
  96. application/json:
  97. schema:
  98. type: object
  99. properties:
  100. type:
  101. type: string
  102. description: 规则:required
  103. article_id:
  104. type: string
  105. description: 规则:required
  106. param:
  107. type: string
  108. required:
  109. - type
  110. - article_id
  111. responses:
  112. 200:
  113. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  114. content:
  115. application/json:
  116. schema:
  117. type: object
  118. properties:
  119. ok:
  120. type: boolean
  121. message:
  122. type: string
  123. data:
  124. type: object
  125. properties:
  126. id:
  127. type: string
  128. type:
  129. type: string
  130. article_id:
  131. type: string
  132. param:
  133. type: string
  134. nullable: true
  135. updated_at:
  136. type: string
  137. title:
  138. type: string
  139. 401:
  140. $ref: '../../main.yaml#/components/responses/Unauthorized'
  141. 422:
  142. $ref: '../../main.yaml#/components/responses/ValidationError'