v3-groups-group-members.yaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-groups-group-members.yaml
  2. get:
  3. summary: 列出团队成员
  4. tags:
  5. - groups
  6. operationId: get_api_v3_groups_group_members
  7. description: |-
  8. 只有团队成员看得到。owner、manager 在前,其余按加入时间排序。
  9. 实现:`V3\GroupMemberController@index`
  10. security:
  11. -
  12. bearerAuth: []
  13. parameters:
  14. -
  15. name: group
  16. in: path
  17. required: true
  18. schema:
  19. type: string
  20. description: '团队 uid'
  21. -
  22. name: per_page
  23. in: query
  24. schema:
  25. type: integer
  26. default: 100
  27. description: '每页数量,最大 200'
  28. -
  29. name: page
  30. in: query
  31. schema:
  32. type: integer
  33. default: 1
  34. description: 页码
  35. responses:
  36. 200:
  37. description: 成功
  38. content:
  39. application/json:
  40. schema:
  41. type: object
  42. properties:
  43. data:
  44. type: array
  45. items:
  46. type: object
  47. properties:
  48. id:
  49. type: string
  50. group_id:
  51. type: string
  52. role:
  53. type: string
  54. joined_at:
  55. type: string
  56. user:
  57. type: object
  58. properties: { id: { type: string }, nickName: { type: string }, userName: { type: string }, realName: { type: string }, sn: { type: integer }, avatar: { type: string }, roles: { type: array, items: { type: string } } }
  59. nullable: true
  60. meta:
  61. $ref: '../../main.yaml#/components/schemas/PaginationMeta'
  62. 401:
  63. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  64. 403:
  65. description: 不是这个团队的成员
  66. content:
  67. application/problem+json:
  68. schema:
  69. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  70. 422:
  71. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  72. post:
  73. summary: 加一名成员
  74. tags:
  75. - groups
  76. operationId: post_api_v3_groups_group_members
  77. description: |-
  78. 团队的 owner / manager 才能调用。角色默认 reader(只读)。
  79. 实现:`V3\GroupMemberController@store`
  80. security:
  81. -
  82. bearerAuth: []
  83. parameters:
  84. -
  85. name: group
  86. in: path
  87. required: true
  88. schema:
  89. type: string
  90. description: '团队 uid'
  91. requestBody:
  92. required: true
  93. content:
  94. application/json:
  95. schema:
  96. type: object
  97. properties:
  98. user_id:
  99. type: string
  100. description: '要加入的用户 uuid'
  101. role:
  102. type: string
  103. description: '角色,默认 reader'
  104. enum:
  105. - manager
  106. - editor
  107. - reader
  108. required:
  109. - user_id
  110. responses:
  111. 200:
  112. description: 成功
  113. content:
  114. application/json:
  115. schema:
  116. type: object
  117. properties:
  118. data:
  119. type: object
  120. properties:
  121. id:
  122. type: string
  123. group_id:
  124. type: string
  125. role:
  126. type: string
  127. joined_at:
  128. type: string
  129. user:
  130. type: object
  131. properties:
  132. id: { type: string }
  133. nickName: { type: string }
  134. userName: { type: string }
  135. realName: { type: string }
  136. sn: { type: integer }
  137. avatar: { type: string }
  138. roles: { type: array, items: { type: string } }
  139. nullable: true
  140. 201:
  141. description: 加入成功
  142. content:
  143. application/json:
  144. schema:
  145. type: object
  146. properties:
  147. data:
  148. type: object
  149. properties:
  150. id:
  151. type: string
  152. group_id:
  153. type: string
  154. role:
  155. type: string
  156. joined_at:
  157. type: string
  158. user:
  159. type: object
  160. properties:
  161. id: { type: string }
  162. nickName: { type: string }
  163. userName: { type: string }
  164. realName: { type: string }
  165. sn: { type: integer }
  166. avatar: { type: string }
  167. roles: { type: array, items: { type: string } }
  168. nullable: true
  169. 401:
  170. $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
  171. 403:
  172. description: 不能管理这个团队的成员
  173. content:
  174. application/problem+json:
  175. schema:
  176. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  177. 422:
  178. $ref: '../../main.yaml#/components/responses/ProblemValidation'