v3-groups-group.yaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-groups-group.yaml
  2. get:
  3. summary: 团队详情
  4. tags:
  5. - groups
  6. operationId: get_api_v3_groups_group_
  7. description: |-
  8. 公开团队谁都能看(可不登录),私有团队只有成员能看。带查看者在团队里的角色。
  9. 实现:`V3\GroupController@show`
  10. security:
  11. - { }
  12. -
  13. bearerAuth: []
  14. parameters:
  15. -
  16. name: group
  17. in: path
  18. required: true
  19. schema:
  20. type: string
  21. description: '团队 uid'
  22. responses:
  23. 200:
  24. description: 成功
  25. content:
  26. application/json:
  27. schema:
  28. type: object
  29. properties:
  30. data:
  31. type: object
  32. properties:
  33. id:
  34. type: string
  35. name:
  36. type: string
  37. description:
  38. type: string
  39. nullable: true
  40. status:
  41. type: integer
  42. owner:
  43. type: object
  44. properties:
  45. id: { type: string }
  46. nickName: { type: string }
  47. userName: { type: string }
  48. realName: { type: string }
  49. sn: { type: integer }
  50. avatar: { type: string }
  51. roles: { type: array, items: { type: string } }
  52. nullable: true
  53. role:
  54. type: string
  55. nullable: true
  56. description: 仅在部分查询口径下返回。
  57. created_at:
  58. type: string
  59. updated_at:
  60. type: string
  61. 403:
  62. description: 私有团队,且不是成员
  63. content:
  64. application/problem+json:
  65. schema:
  66. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  67. 422:
  68. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  69. delete:
  70. summary: 删团队
  71. tags:
  72. - groups
  73. operationId: delete_api_v3_groups_group_
  74. description: |-
  75. 只有 owner 能删。团队名下还有资源(channel、文章等)时拒绝,`resources` 里给出各类的条数;
  76. 否则连同成员与共享给团队的记录一起硬删,返回 204 空体。
  77. 实现:`V3\GroupController@destroy`
  78. security:
  79. -
  80. bearerAuth: []
  81. parameters:
  82. -
  83. name: group
  84. in: path
  85. required: true
  86. schema:
  87. type: string
  88. description: '团队 uid'
  89. responses:
  90. 204:
  91. description: 已删除,无响应体
  92. 401:
  93. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  94. 403:
  95. description: '只有 owner 能删'
  96. content:
  97. application/problem+json:
  98. schema:
  99. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  100. 409:
  101. description: 团队名下还有资源
  102. content:
  103. application/problem+json:
  104. schema:
  105. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  106. 422:
  107. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  108. patch:
  109. summary: 改团队信息
  110. tags:
  111. - groups
  112. operationId: patch_api_v3_groups_group_
  113. description: |-
  114. 团队的 owner / manager 才能调用,只改传了的字段。
  115. 实现:`V3\GroupController@update`
  116. security:
  117. -
  118. bearerAuth: []
  119. parameters:
  120. -
  121. name: group
  122. in: path
  123. required: true
  124. schema:
  125. type: string
  126. description: '团队 uid'
  127. requestBody:
  128. required: false
  129. content:
  130. application/json:
  131. schema:
  132. type: object
  133. properties:
  134. name:
  135. type: string
  136. description: '团队名,最长 64'
  137. description:
  138. type: string
  139. description: '简介,最长 1024'
  140. status:
  141. type: integer
  142. description: '10 私有、30 公开'
  143. responses:
  144. 200:
  145. description: 成功
  146. content:
  147. application/json:
  148. schema:
  149. type: object
  150. properties:
  151. data:
  152. type: object
  153. properties:
  154. id:
  155. type: string
  156. name:
  157. type: string
  158. description:
  159. type: string
  160. nullable: true
  161. status:
  162. type: integer
  163. owner:
  164. type: object
  165. properties:
  166. id: { type: string }
  167. nickName: { type: string }
  168. userName: { type: string }
  169. realName: { type: string }
  170. sn: { type: integer }
  171. avatar: { type: string }
  172. roles: { type: array, items: { type: string } }
  173. nullable: true
  174. role:
  175. type: string
  176. nullable: true
  177. description: 仅在部分查询口径下返回。
  178. created_at:
  179. type: string
  180. updated_at:
  181. type: string
  182. 401:
  183. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  184. 403:
  185. description: 不能修改这个团队
  186. content:
  187. application/problem+json:
  188. schema:
  189. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  190. 422:
  191. $ref: '../../main.yaml#/components/responses/ProblemValidation'