소스 검색

✨ 团队迁 v3:成员、角色、团队本身与团队文档;团队空间加「成员管理」

团队(group)相关的 v2 接口全部迁到 v3,dashboard-v6 彻底切过去(不再有 v2 团队调用):

- 成员:`me/groups`(带我的角色、member_id,可按 owned / search 过滤,数量读 meta.total)、
  `groups/{group}/members` 增删改查。新增角色列 group_members.role(owner / manager /
  editor / reader,为空按 v2 power 推导,v4 下线后回填改 NOT NULL);改角色 role 与 power
  同写;本人可退出团队;owner 行不可改不可移
- 团队本身:`groups` 搜公开团队、建、看、改(owner / manager)、删(只有 owner,名下还有
  资源时 409 并给出各类条数)
- 团队文档:`groups/{group}/shares` 列表与移出(团队 owner / manager 或资源拥有者)
- 权限表集中在 App\Services\V3\GroupAbilityService,后续资源的团队空间权限都走它
- 不支持 agent 代写;v2 旧端点经 overrides 标为已取代,CLAUDE.md 对照表补两行

团队空间:进入团队空间后「协作 → 团队空间」(我加入的团队列表)置灰,新增只在团队空间
可用的「协作 → 成员管理」;成员列表与团队文档在切换团队后会重新请求。

顺带修的:
- V3\Authenticate 实现 AuthenticatesRequests,排在路由模型绑定之前——未登录访问不存在的
  资源先 401,不再 404 泄露资源是否存在(对所有挂 auth.v3 的 v3 路由生效)
- 主导航的 activeId / scopeId 交给 antd 前剥掉,消掉「未知 DOM 属性」警告
- 团队页「退出团队」按钮原来没有接事件

测试:Pest 新增约 80 条;api-test 新增 13_groups.php(全量 92 条通过);dashboard-test 新增
group-members.spec / groups.spec,teamspace.spec 补切换团队用例。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
visuddhinanda 4 일 전
부모
커밋
8ef4af657a
100개의 변경된 파일과 16772개의 추가작업 그리고 604개의 파일을 삭제
  1. 2 0
      CLAUDE.md
  2. 227 0
      api-test/cases/13_groups.php
  3. 48 0
      api-test/client/.openapi-generator/FILES
  4. 6 6
      api-test/client/lib/Api/AdminApi.php
  5. 4067 0
      api-test/client/lib/Api/GroupsApi.php
  6. 39 35
      api-test/client/lib/Model/GetApiV3AdminAgentFeedback200ResponseDataInner.php
  7. 73 1
      api-test/client/lib/Model/GetApiV3AdminAgentRuns200ResponseDataInner.php
  8. 443 0
      api-test/client/lib/Model/GetApiV3Groups200Response.php
  9. 668 0
      api-test/client/lib/Model/GetApiV3Groups200ResponseDataInner.php
  10. 443 0
      api-test/client/lib/Model/GetApiV3GroupsGroupMembers200Response.php
  11. 552 0
      api-test/client/lib/Model/GetApiV3GroupsGroupMembers200ResponseDataInner.php
  12. 443 0
      api-test/client/lib/Model/GetApiV3GroupsGroupShares200Response.php
  13. 511 0
      api-test/client/lib/Model/GetApiV3GroupsGroupShares200ResponseDataInner.php
  14. 566 0
      api-test/client/lib/Model/GetApiV3GroupsGroupShares200ResponseDataInnerResource.php
  15. 443 0
      api-test/client/lib/Model/GetApiV3MeGroups200Response.php
  16. 729 0
      api-test/client/lib/Model/GetApiV3MeGroups200ResponseDataInner.php
  17. 445 0
      api-test/client/lib/Model/PatchApiV3GroupsGroupMembersMemberRequest.php
  18. 477 0
      api-test/client/lib/Model/PatchApiV3GroupsGroupRequest.php
  19. 2 2
      api-test/client/lib/Model/PostApiV3AgentChargesRequest.php
  20. 35 1
      api-test/client/lib/Model/PostApiV3AgentTraces200ResponseData.php
  21. 409 0
      api-test/client/lib/Model/PostApiV3Groups200Response.php
  22. 409 0
      api-test/client/lib/Model/PostApiV3GroupsGroupMembers200Response.php
  23. 482 0
      api-test/client/lib/Model/PostApiV3GroupsGroupMembersRequest.php
  24. 480 0
      api-test/client/lib/Model/PostApiV3GroupsRequest.php
  25. 5 0
      api-test/fixtures.php
  26. 121 0
      api-v13/app/Http/Controllers/V3/GroupController.php
  27. 114 0
      api-v13/app/Http/Controllers/V3/GroupMemberController.php
  28. 65 0
      api-v13/app/Http/Controllers/V3/GroupShareController.php
  29. 48 0
      api-v13/app/Http/Controllers/V3/MeGroupController.php
  30. 5 1
      api-v13/app/Http/Middleware/V3/Authenticate.php
  31. 31 0
      api-v13/app/Http/Requests/V3/IndexGroupMemberRequest.php
  32. 32 0
      api-v13/app/Http/Requests/V3/IndexGroupRequest.php
  33. 31 0
      api-v13/app/Http/Requests/V3/IndexGroupShareRequest.php
  34. 33 0
      api-v13/app/Http/Requests/V3/IndexMeGroupRequest.php
  35. 33 0
      api-v13/app/Http/Requests/V3/StoreGroupMemberRequest.php
  36. 33 0
      api-v13/app/Http/Requests/V3/StoreGroupRequest.php
  37. 32 0
      api-v13/app/Http/Requests/V3/UpdateGroupMemberRequest.php
  38. 33 0
      api-v13/app/Http/Requests/V3/UpdateGroupRequest.php
  39. 41 0
      api-v13/app/Http/Resources/V3/GroupMemberResource.php
  40. 48 0
      api-v13/app/Http/Resources/V3/GroupResource.php
  41. 36 0
      api-v13/app/Http/Resources/V3/GroupShareResource.php
  42. 51 0
      api-v13/app/Http/Resources/V3/MeGroupResource.php
  43. 38 0
      api-v13/app/Models/GroupInfo.php
  44. 65 0
      api-v13/app/Models/GroupMember.php
  45. 88 0
      api-v13/app/Services/V3/GroupAbilityService.php
  46. 169 0
      api-v13/app/Services/V3/GroupMemberService.php
  47. 253 0
      api-v13/app/Services/V3/GroupService.php
  48. 122 0
      api-v13/app/Services/V3/GroupShareService.php
  49. 33 0
      api-v13/database/migrations/2026_11_13_080428_add_role_to_group_members_table.php
  50. 8 0
      api-v13/resources/lang/en/messages.php
  51. 8 0
      api-v13/resources/lang/zh-Hans/messages.php
  52. 1 0
      api-v13/routes/api.php
  53. 50 0
      api-v13/routes/v3/group.php
  54. 303 0
      api-v13/tests/Feature/GroupMemberV3Test.php
  55. 122 0
      api-v13/tests/Feature/GroupShareV3Test.php
  56. 268 0
      api-v13/tests/Feature/GroupV3Test.php
  57. 27 0
      api-v13/tests/Pest.php
  58. 153 0
      dashboard-test/src/tests/group-members.spec.ts
  59. 138 0
      dashboard-test/src/tests/groups.spec.ts
  60. 77 11
      dashboard-test/src/tests/teamspace.spec.ts
  61. 4 0
      dashboard-v6/src/api/Auth.ts
  62. 101 0
      dashboard-v6/src/api/group-member.ts
  63. 85 85
      dashboard-v6/src/api/group.ts
  64. 899 15
      dashboard-v6/src/api/schema.d.ts
  65. 24 23
      dashboard-v6/src/components/group/AddMember.tsx
  66. 8 22
      dashboard-v6/src/components/group/GroupCreate.tsx
  67. 72 105
      dashboard-v6/src/components/group/GroupFile.tsx
  68. 98 133
      dashboard-v6/src/components/group/GroupMember.tsx
  69. 7 13
      dashboard-v6/src/components/group/GroupSelect.tsx
  70. 28 7
      dashboard-v6/src/components/navigation/MainMenu.tsx
  71. 37 17
      dashboard-v6/src/features/group/GroupEdit.tsx
  72. 72 75
      dashboard-v6/src/features/group/GroupList.tsx
  73. 33 4
      dashboard-v6/src/features/group/GroupShow.tsx
  74. 9 7
      dashboard-v6/src/features/teamspace/TeamspaceGuard.tsx
  75. 24 0
      dashboard-v6/src/features/teamspace/refreshMyGroups.ts
  76. 19 5
      dashboard-v6/src/features/teamspace/scope.ts
  77. 4 15
      dashboard-v6/src/load.ts
  78. 1 0
      dashboard-v6/src/locales/en-US/forms.ts
  79. 13 0
      dashboard-v6/src/locales/en-US/label.ts
  80. 1 0
      dashboard-v6/src/locales/zh-Hans/forms.ts
  81. 13 0
      dashboard-v6/src/locales/zh-Hans/label.ts
  82. 1 0
      dashboard-v6/src/locales/zh-Hant/forms.ts
  83. 13 0
      dashboard-v6/src/locales/zh-Hant/label.ts
  84. 25 0
      dashboard-v6/src/pages/workspace/members/index.tsx
  85. 0 6
      dashboard-v6/src/pages/workspace/team/index.tsx
  86. 7 0
      dashboard-v6/src/routes/teamRoutes.ts
  87. 14 0
      openapi/public/assets/protocol/main.yaml
  88. 17 0
      openapi/public/assets/protocol/overrides/v2-group-group.yaml
  89. 14 0
      openapi/public/assets/protocol/overrides/v2-group-member-group-member.yaml
  90. 11 0
      openapi/public/assets/protocol/overrides/v2-group-member.yaml
  91. 5 0
      openapi/public/assets/protocol/overrides/v2-group-my-number.yaml
  92. 11 0
      openapi/public/assets/protocol/overrides/v2-group.yaml
  93. 12 4
      openapi/public/assets/protocol/resources/auto/v2-group-group.yaml
  94. 10 3
      openapi/public/assets/protocol/resources/auto/v2-group-member-group-member.yaml
  95. 11 5
      openapi/public/assets/protocol/resources/auto/v2-group-member.yaml
  96. 3 1
      openapi/public/assets/protocol/resources/auto/v2-group-my-number.yaml
  97. 8 2
      openapi/public/assets/protocol/resources/auto/v2-group.yaml
  98. 123 0
      openapi/public/assets/protocol/resources/auto/v3-groups-group-members-member.yaml
  99. 180 0
      openapi/public/assets/protocol/resources/auto/v3-groups-group-members.yaml
  100. 41 0
      openapi/public/assets/protocol/resources/auto/v3-groups-group-shares-share.yaml

+ 2 - 0
CLAUDE.md

@@ -356,6 +356,8 @@ Resource / FormRequest / 测试同理;URL 只换版本前缀
 | `sign-in` + `auth/current` / `AuthController@signIn` + `@getUserInfoByToken` | `sessions` + `me` / `V3\SessionController` + `V3\MeController` | 登录一次返回 `{token, user}`,不再二次查询;`login` 字段收用户名或邮箱(邮箱不区分大小写),失败统一 422 `errors.login`;按账号 + IP 限流。`me` 的字段沿用 v2 的驼峰用户摘要(`UserService::profile()`),`roles` 恒为数组,另加 `email`,不再回显 token。token 与 v2 完全相同、两边互认 |
 | `sign-in` + `auth/current` / `AuthController@signIn` + `@getUserInfoByToken` | `sessions` + `me` / `V3\SessionController` + `V3\MeController` | 登录一次返回 `{token, user}`,不再二次查询;`login` 字段收用户名或邮箱(邮箱不区分大小写),失败统一 422 `errors.login`;按账号 + IP 限流。`me` 的字段沿用 v2 的驼峰用户摘要(`UserService::profile()`),`roles` 恒为数组,另加 `email`,不再回显 token。token 与 v2 完全相同、两边互认 |
 | `search-title-index` / `SearchTitleController@index` | `tipitaka-chapters` / `V3\TipitakaChapterController` | 章节标题检索。v2 只回标题文字、`LIKE` 硬匹配、依赖去变音不干净的 `title_en`;v3 回坐标(book/para)、层级、`layer`(mula/atthakatha/tika/anna,取自书的 tag)、段数与字符数、上下章、路径、公开 channel 的章节译名;匹配不分大小写与变音符号、去序号与丛书缩写、拼错按编辑距离容错(档位:相等 1 / 开头 0.95 / 包含 0.9 / 拼错 ≤0.85)。不给 `q` 给 `book`(可加 `para`、`max_level`)= 按经文顺序列出整本书的标题,给 agent「先选书再选章」用。标题目录缓存一天(`TipitakaChapterService`)。**`q` 的 PHP 匹配只用来验证按名定位的效果,正式实现走 OpenSearch**(插件 `locate` 将改调 `/v3/search`,见 `api-v13/documents/search-recall.md` 4.6),这里不再扩展 |
 | `search-title-index` / `SearchTitleController@index` | `tipitaka-chapters` / `V3\TipitakaChapterController` | 章节标题检索。v2 只回标题文字、`LIKE` 硬匹配、依赖去变音不干净的 `title_en`;v3 回坐标(book/para)、层级、`layer`(mula/atthakatha/tika/anna,取自书的 tag)、段数与字符数、上下章、路径、公开 channel 的章节译名;匹配不分大小写与变音符号、去序号与丛书缩写、拼错按编辑距离容错(档位:相等 1 / 开头 0.95 / 包含 0.9 / 拼错 ≤0.85)。不给 `q` 给 `book`(可加 `para`、`max_level`)= 按经文顺序列出整本书的标题,给 agent「先选书再选章」用。标题目录缓存一天(`TipitakaChapterService`)。**`q` 的 PHP 匹配只用来验证按名定位的效果,正式实现走 OpenSearch**(插件 `locate` 将改调 `/v3/search`,见 `api-v13/documents/search-recall.md` 4.6),这里不再扩展 |
 | `progress?view=chapter_channels` / `ProgressChapterController@index`(一个 view 分支) | `tipitaka-chapter-channels/{book}/{para}` / `V3\TipitakaChapterChannelController` | 某章有哪些 channel 及完成度(阅读页版本切换)。`par`→路径 `{para}`;**只列看得见的 channel**(公开 + 自己的 + 共享给自己或所在群组的;v2 连私有 channel 也对所有人列);字段重组:行 `uid`→`id`,`channel_id`/`name`/`type` 收进 `channel{id,name,type,lang}`;去掉 `likes`(前端没用);views/studio 整页批量查,消除 N+1;按 progress 降序 + channel_id 稳定排序,分页(per_page 最大 200)。v6、mobile、wikipali-plugins(`versions --chapter`)已切 |
 | `progress?view=chapter_channels` / `ProgressChapterController@index`(一个 view 分支) | `tipitaka-chapter-channels/{book}/{para}` / `V3\TipitakaChapterChannelController` | 某章有哪些 channel 及完成度(阅读页版本切换)。`par`→路径 `{para}`;**只列看得见的 channel**(公开 + 自己的 + 共享给自己或所在群组的;v2 连私有 channel 也对所有人列);字段重组:行 `uid`→`id`,`channel_id`/`name`/`type` 收进 `channel{id,name,type,lang}`;去掉 `likes`(前端没用);views/studio 整页批量查,消除 N+1;按 progress 降序 + channel_id 稳定排序,分页(per_page 最大 200)。v6、mobile、wikipali-plugins(`versions --chapter`)已切 |
+| `group-member`(`view=user`、`view=group`、新建、删除)/ `GroupMemberController` | `me/groups` + `groups/{group}/members`(+`/{member}`)/ `V3\MeGroupController` + `V3\GroupMemberController` | 团队成员(界面叫「团队」,团队空间以团队为 owner)。新增角色列 `group_members.role`(owner / manager / editor / reader,为空按 v2 的 `power` 推导,v4 下线后回填并改 NOT NULL);改角色是新增的 PATCH(role 与 power 同写),加人可指定角色、默认 reader;本人可退出(v2 普通成员退不了);owner 那行不可改、不可移;不支持 agent 代写。`me/groups` 每条带我的 `role` 与 `member_id`。权限表在 `App\Services\V3\GroupAbilityService`,后续资源的团队空间权限都走它。团队本身(`/v2/group`)未迁 |
+| `group`(`view=all`、`view=studio`+`view2`、单条、新建、修改、删除)+ `group-my-number` + `share?view=group` / `GroupController` + `ShareController@index` | `groups`(+`/{group}`)+ `me/groups?owned=&search=` + `groups/{group}/shares`(+`/{share}`)/ `V3\GroupController` + `V3\MeGroupController` + `V3\GroupShareController` | 团队本身与团队文档。`view=all`→`GET groups?search=`,**只搜公开团队**(v2 不登录就能列出私有团队);「我创建的 / 我参加的」→`me/groups?owned=true\|false`,`group-my-number` 去掉、数量读 `meta.total`;新建不收 `studio_name`(由登录态决定)、同一人名下不重名;改信息 owner 与 manager 都能改(v2 只有 owner),只有 PATCH,不再覆盖 `create_time`;删除只有 owner,**名下还有资源(channel、文章等 16 类 owner 列)时 409** 并给出各类条数,否则连同成员与共享给团队的 share 一起硬删(v2 照删、资源变孤儿);详情带查看者的 `role`,私有团队非成员 403。团队文档每项带资源类型 / 标题 / 拥有者摘要与团队对它的权限(reader / editor),团队 owner / manager 或资源拥有者可移出团队。资源本身的协作者管理(`share?view=res`、给人加共享)仍走 v2。不支持 agent 代写 |
 
 
 **注意**:`tipitaka-reading` **不是** v2 `paragraph-content` / `chapter-content` 的替代品。
 **注意**:`tipitaka-reading` **不是** v2 `paragraph-content` / `chapter-content` 的替代品。
 那两个 v2 端点支持多 channel(`channels=a,b,c`)与 edit 模式、返回 sentenceIds 供编辑器用;
 那两个 v2 端点支持多 channel(`channels=a,b,c`)与 edit 模式、返回 sentenceIds 供编辑器用;

+ 227 - 0
api-test/cases/13_groups.php

@@ -0,0 +1,227 @@
+<?php
+
+use \WikipaliApi\Api\GroupsApi;
+use \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest;
+use \WikipaliApi\Model\PatchApiV3GroupsGroupRequest;
+use \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest;
+use \WikipaliApi\Model\PostApiV3GroupsRequest;
+
+/*
+ * v3 团队:/v3/groups(搜索、建、看、改、删)、/v3/me/groups、成员、团队文档。
+ * 固定的测试团队只在测试账号名下没有时建一次,跑完保留;「建 → 改 → 删」那一轮用临时团队。
+ */
+
+/** 测试账号名下的测试团队 uid:没有就建一个 */
+function test_group(string $token): string
+{
+    $name = fixtures()['group_name'];
+    $find = function () use ($token, $name): ?string {
+        $res = request(fn () => api(GroupsApi::class, $token)->getApiV3MeGroupsWithHttpInfo(per_page: 200));
+        assert_status(200, $res, 'me/groups');
+        foreach ($res['body']['data'] as $group) {
+            if ($group['name'] === $name && $group['role'] === 'owner') {
+                return $group['id'];
+            }
+        }
+
+        return null;
+    };
+    if ($id = $find()) {
+        return $id;
+    }
+    $body = new PostApiV3GroupsRequest();
+    $body->setName($name);
+    $res = request(fn () => api(GroupsApi::class, $token)->postApiV3GroupsWithHttpInfo($body));
+    assert_status(201, $res, '建测试团队');
+
+    return $res['body']['data']['id'];
+}
+
+/** 第二个账号的 uuid(经 v2 用户搜索) */
+function second_user(string $token): ?string
+{
+    $username = fixtures()['group_member_username'];
+    if (! $username) {
+        return null;
+    }
+    $res = raw('GET', '/v2/user', ['view' => 'key', 'key' => $username], null, $token);
+    foreach ($res['body']['data']['rows'] ?? [] as $row) {
+        if (($row['userName'] ?? null) === $username) {
+            return $row['id'];
+        }
+    }
+
+    return null;
+}
+
+/* ---- 无 token → 401 ---- */
+
+test('GET /v3/me/groups(无 token)→ 401', function () {
+    $res = request(fn () => api(GroupsApi::class)->getApiV3MeGroupsWithHttpInfo());
+    assert_status(401, $res, 'me/groups 无 token');
+    assert_problem($res, 'me/groups 无 token');
+});
+
+test('GET /v3/groups/{group}/members(无 token)→ 401', function () {
+    $res = request(fn () => api(GroupsApi::class)->getApiV3GroupsGroupMembersWithHttpInfo('11111111-1111-4111-8111-111111111111'));
+    assert_status(401, $res, 'members 无 token');
+    assert_problem($res, 'members 无 token');
+});
+
+test('POST /v3/groups/{group}/members(无 token)→ 401', function () {
+    $body = new PostApiV3GroupsGroupMembersRequest();
+    $body->setUserId('11111111-1111-4111-8111-111111111111');
+    $res = request(fn () => api(GroupsApi::class)->postApiV3GroupsGroupMembersWithHttpInfo('11111111-1111-4111-8111-111111111111', $body));
+    assert_status(401, $res, 'members POST 无 token');
+    assert_problem($res, 'members POST 无 token');
+});
+
+/* ---- 带 token ---- */
+
+test('GET /v3/me/groups → 200,带我的角色', function () {
+    $token = required_token();
+    $group = test_group($token);
+    $res = request(fn () => api(GroupsApi::class, $token)->getApiV3MeGroupsWithHttpInfo());
+    assert_status(200, $res, 'me/groups');
+    assert_has_key('meta', $res['body'], 'me/groups');
+    $mine = array_values(array_filter($res['body']['data'], fn ($g) => $g['id'] === $group))[0] ?? null;
+    assert_eq('owner', $mine['role'] ?? null, 'me/groups 测试团队的角色');
+    assert_has_key('member_id', $mine, 'me/groups.data[]');
+});
+
+test('GET /v3/groups/{group}/members → 200;不存在的团队 → 404', function () {
+    $token = required_token();
+    $group = test_group($token);
+    $res = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsGroupMembersWithHttpInfo($group));
+    assert_status(200, $res, 'members');
+    $first = $res['body']['data'][0] ?? null;
+    foreach (['id', 'group_id', 'role', 'joined_at', 'user'] as $key) {
+        assert_has_key($key, $first, 'members.data[0]');
+    }
+    assert_eq('owner', $first['role'], 'members 第一行是 owner');
+
+    $missing = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsGroupMembersWithHttpInfo('11111111-1111-4111-8111-111111111111'));
+    assert_status(404, $missing, 'members 团队不存在');
+});
+
+test('POST /v3/groups/{group}/members(缺 user_id)→ 422', function () {
+    $token = required_token();
+    $group = test_group($token);
+    $res = raw('POST', "/v3/groups/{$group}/members", null, ['role' => 'reader'], $token);
+    assert_status(422, $res, 'members 缺 user_id');
+    assert_field_error('user_id', $res, 'members 缺 user_id');
+});
+
+test('groups 成员一轮:加人 201 → 改角色 200 → 改 owner 403 → 移人 204 → 再移 404', function () {
+    $token = required_token();
+    $group = test_group($token);
+    $userId = second_user($token) ?? skip('fixtures.group_member_username 对应的账号不存在');
+
+    // 上次中断可能留下这个人,先清掉
+    $list = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsGroupMembersWithHttpInfo($group, per_page: 200));
+    foreach ($list['body']['data'] as $row) {
+        if (($row['user']['id'] ?? null) === $userId) {
+            raw('DELETE', "/v3/groups/{$group}/members/{$row['id']}", null, null, $token);
+        }
+    }
+
+    $body = new PostApiV3GroupsGroupMembersRequest();
+    $body->setUserId($userId);
+    $add = request(fn () => api(GroupsApi::class, $token)->postApiV3GroupsGroupMembersWithHttpInfo($group, $body));
+    assert_status(201, $add, '加人');
+    assert_eq('reader', $add['body']['data']['role'] ?? null, '加人默认角色');
+    $member = $add['body']['data']['id'];
+
+    $patch = new PatchApiV3GroupsGroupMembersMemberRequest();
+    $patch->setRole('editor');
+    $update = request(fn () => api(GroupsApi::class, $token)->patchApiV3GroupsGroupMembersMemberWithHttpInfo($group, $member, $patch));
+    assert_status(200, $update, '改角色');
+    assert_eq('editor', $update['body']['data']['role'] ?? null, '改角色后');
+
+    $ownerRow = $list['body']['data'][0]['id'];
+    $patchOwner = request(fn () => api(GroupsApi::class, $token)->patchApiV3GroupsGroupMembersMemberWithHttpInfo($group, $ownerRow, $patch));
+    assert_status(403, $patchOwner, '改 owner');
+    assert_problem($patchOwner, '改 owner');
+
+    $remove = request(fn () => api(GroupsApi::class, $token)->deleteApiV3GroupsGroupMembersMemberWithHttpInfo($group, $member));
+    assert_status(204, $remove, '移人');
+
+    $again = request(fn () => api(GroupsApi::class, $token)->deleteApiV3GroupsGroupMembersMemberWithHttpInfo($group, $member));
+    assert_status(404, $again, '再移');
+});
+
+/* ---- 团队本身 ---- */
+
+test('GET /v3/groups(无 token)→ 401', function () {
+    $res = request(fn () => api(GroupsApi::class)->getApiV3GroupsWithHttpInfo());
+    assert_status(401, $res, 'groups 无 token');
+    assert_problem($res, 'groups 无 token');
+});
+
+test('GET /v3/groups?search= → 200,只列公开团队', function () {
+    $token = required_token();
+    test_group($token);
+    $res = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsWithHttpInfo(search: fixtures()['group_name']));
+    assert_status(200, $res, 'groups 搜索');
+    assert_has_key('meta', $res['body'], 'groups 搜索');
+    foreach ($res['body']['data'] as $group) {
+        assert_eq(30, $group['status'], 'groups 搜索结果都是公开团队');
+    }
+});
+
+test('GET /v3/groups/{group} → 200 带我的角色;不存在 → 404', function () {
+    $token = required_token();
+    $group = test_group($token);
+    $res = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsGroupWithHttpInfo($group));
+    assert_status(200, $res, 'group 详情');
+    assert_eq('owner', $res['body']['data']['role'] ?? null, 'group 详情里我的角色');
+
+    $missing = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsGroupWithHttpInfo('11111111-1111-4111-8111-111111111111'));
+    assert_status(404, $missing, 'group 不存在');
+});
+
+test('POST /v3/groups(缺 name)→ 422;(无 token)→ 401', function () {
+    $token = required_token();
+    $res = raw('POST', '/v3/groups', null, ['description' => 'x'], $token);
+    assert_status(422, $res, 'groups 缺 name');
+    assert_field_error('name', $res, 'groups 缺 name');
+
+    $anon = raw('POST', '/v3/groups', null, ['name' => 'x']);
+    assert_status(401, $anon, 'groups POST 无 token');
+});
+
+test('groups 一轮:建 201 → 改 200 → 删 204 → 再看 404', function () {
+    $token = required_token();
+    $body = new PostApiV3GroupsRequest();
+    $body->setName('e2e-tmp-'.time());
+    $create = request(fn () => api(GroupsApi::class, $token)->postApiV3GroupsWithHttpInfo($body));
+    assert_status(201, $create, '建团队');
+    assert_eq('owner', $create['body']['data']['role'] ?? null, '建团队后我的角色');
+    $group = $create['body']['data']['id'];
+
+    $patch = new PatchApiV3GroupsGroupRequest();
+    $patch->setDescription('api-test');
+    $patch->setStatus(10);
+    $update = request(fn () => api(GroupsApi::class, $token)->patchApiV3GroupsGroupWithHttpInfo($group, $patch));
+    assert_status(200, $update, '改团队');
+    assert_eq(10, $update['body']['data']['status'] ?? null, '改团队后的状态');
+
+    $delete = request(fn () => api(GroupsApi::class, $token)->deleteApiV3GroupsGroupWithHttpInfo($group));
+    assert_status(204, $delete, '删团队');
+
+    $gone = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsGroupWithHttpInfo($group));
+    assert_status(404, $gone, '删后再看');
+});
+
+/* ---- 团队文档 ---- */
+
+test('GET /v3/groups/{group}/shares → 200;(无 token)→ 401', function () {
+    $token = required_token();
+    $group = test_group($token);
+    $res = request(fn () => api(GroupsApi::class, $token)->getApiV3GroupsGroupSharesWithHttpInfo($group));
+    assert_status(200, $res, 'group shares');
+    assert_has_key('meta', $res['body'], 'group shares');
+
+    $anon = request(fn () => api(GroupsApi::class)->getApiV3GroupsGroupSharesWithHttpInfo($group));
+    assert_status(401, $anon, 'group shares 无 token');
+});

+ 48 - 0
api-test/client/.openapi-generator/FILES

@@ -15,6 +15,7 @@ docs/Api/AgentTracesApi.md
 docs/Api/CreditPolicyApi.md
 docs/Api/CreditPolicyApi.md
 docs/Api/DiscussionsApi.md
 docs/Api/DiscussionsApi.md
 docs/Api/EmailCertificationsApi.md
 docs/Api/EmailCertificationsApi.md
+docs/Api/GroupsApi.md
 docs/Api/HeartbeatApi.md
 docs/Api/HeartbeatApi.md
 docs/Api/InvitesApi.md
 docs/Api/InvitesApi.md
 docs/Api/MeApi.md
 docs/Api/MeApi.md
@@ -76,6 +77,13 @@ docs/Model/GetApiV3Discussions200ResponseDataInnerSentence.md
 docs/Model/GetApiV3DiscussionsSummary200Response.md
 docs/Model/GetApiV3DiscussionsSummary200Response.md
 docs/Model/GetApiV3DiscussionsSummary200ResponseData.md
 docs/Model/GetApiV3DiscussionsSummary200ResponseData.md
 docs/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.md
 docs/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.md
+docs/Model/GetApiV3Groups200Response.md
+docs/Model/GetApiV3Groups200ResponseDataInner.md
+docs/Model/GetApiV3GroupsGroupMembers200Response.md
+docs/Model/GetApiV3GroupsGroupMembers200ResponseDataInner.md
+docs/Model/GetApiV3GroupsGroupShares200Response.md
+docs/Model/GetApiV3GroupsGroupShares200ResponseDataInner.md
+docs/Model/GetApiV3GroupsGroupShares200ResponseDataInnerResource.md
 docs/Model/GetApiV3Heartbeat200Response.md
 docs/Model/GetApiV3Heartbeat200Response.md
 docs/Model/GetApiV3Heartbeat200ResponseData.md
 docs/Model/GetApiV3Heartbeat200ResponseData.md
 docs/Model/GetApiV3Me200Response.md
 docs/Model/GetApiV3Me200Response.md
@@ -84,6 +92,8 @@ docs/Model/GetApiV3MeAgentThreads200Response.md
 docs/Model/GetApiV3MeAgentThreads200ResponseDataInner.md
 docs/Model/GetApiV3MeAgentThreads200ResponseDataInner.md
 docs/Model/GetApiV3MeAgentThreads200ResponseDataInnerRunsInner.md
 docs/Model/GetApiV3MeAgentThreads200ResponseDataInnerRunsInner.md
 docs/Model/GetApiV3MeAgentThreadsThread200Response.md
 docs/Model/GetApiV3MeAgentThreadsThread200Response.md
+docs/Model/GetApiV3MeGroups200Response.md
+docs/Model/GetApiV3MeGroups200ResponseDataInner.md
 docs/Model/GetApiV3MeReactions200Response.md
 docs/Model/GetApiV3MeReactions200Response.md
 docs/Model/GetApiV3MeReactions200ResponseDataInner.md
 docs/Model/GetApiV3MeReactions200ResponseDataInner.md
 docs/Model/GetApiV3PasswordResetsToken200Response.md
 docs/Model/GetApiV3PasswordResetsToken200Response.md
@@ -115,6 +125,8 @@ docs/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200Response.md
 docs/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseDataInner.md
 docs/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseDataInner.md
 docs/Model/PaginationMeta.md
 docs/Model/PaginationMeta.md
 docs/Model/PatchApiV3DiscussionsDiscussionRequest.md
 docs/Model/PatchApiV3DiscussionsDiscussionRequest.md
+docs/Model/PatchApiV3GroupsGroupMembersMemberRequest.md
+docs/Model/PatchApiV3GroupsGroupRequest.md
 docs/Model/PatchApiV3MeAgentThreadsThreadRequest.md
 docs/Model/PatchApiV3MeAgentThreadsThreadRequest.md
 docs/Model/PatchApiV3PasswordResetsTokenRequest.md
 docs/Model/PatchApiV3PasswordResetsTokenRequest.md
 docs/Model/PostApiV3AgentCharges200Response.md
 docs/Model/PostApiV3AgentCharges200Response.md
@@ -140,6 +152,10 @@ docs/Model/PostApiV3DiscussionsBatchCountRequestTargetsInner.md
 docs/Model/PostApiV3DiscussionsDiscussionRepliesRequest.md
 docs/Model/PostApiV3DiscussionsDiscussionRepliesRequest.md
 docs/Model/PostApiV3DiscussionsRequest.md
 docs/Model/PostApiV3DiscussionsRequest.md
 docs/Model/PostApiV3EmailCertificationsRequest.md
 docs/Model/PostApiV3EmailCertificationsRequest.md
+docs/Model/PostApiV3Groups200Response.md
+docs/Model/PostApiV3GroupsGroupMembers200Response.md
+docs/Model/PostApiV3GroupsGroupMembersRequest.md
+docs/Model/PostApiV3GroupsRequest.md
 docs/Model/PostApiV3Invites200Response.md
 docs/Model/PostApiV3Invites200Response.md
 docs/Model/PostApiV3Invites200ResponseData.md
 docs/Model/PostApiV3Invites200ResponseData.md
 docs/Model/PostApiV3InvitesRequest.md
 docs/Model/PostApiV3InvitesRequest.md
@@ -169,6 +185,7 @@ lib/Api/AgentTracesApi.php
 lib/Api/CreditPolicyApi.php
 lib/Api/CreditPolicyApi.php
 lib/Api/DiscussionsApi.php
 lib/Api/DiscussionsApi.php
 lib/Api/EmailCertificationsApi.php
 lib/Api/EmailCertificationsApi.php
+lib/Api/GroupsApi.php
 lib/Api/HeartbeatApi.php
 lib/Api/HeartbeatApi.php
 lib/Api/InvitesApi.php
 lib/Api/InvitesApi.php
 lib/Api/MeApi.php
 lib/Api/MeApi.php
@@ -234,6 +251,13 @@ lib/Model/GetApiV3Discussions200ResponseDataInnerSentence.php
 lib/Model/GetApiV3DiscussionsSummary200Response.php
 lib/Model/GetApiV3DiscussionsSummary200Response.php
 lib/Model/GetApiV3DiscussionsSummary200ResponseData.php
 lib/Model/GetApiV3DiscussionsSummary200ResponseData.php
 lib/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.php
 lib/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.php
+lib/Model/GetApiV3Groups200Response.php
+lib/Model/GetApiV3Groups200ResponseDataInner.php
+lib/Model/GetApiV3GroupsGroupMembers200Response.php
+lib/Model/GetApiV3GroupsGroupMembers200ResponseDataInner.php
+lib/Model/GetApiV3GroupsGroupShares200Response.php
+lib/Model/GetApiV3GroupsGroupShares200ResponseDataInner.php
+lib/Model/GetApiV3GroupsGroupShares200ResponseDataInnerResource.php
 lib/Model/GetApiV3Heartbeat200Response.php
 lib/Model/GetApiV3Heartbeat200Response.php
 lib/Model/GetApiV3Heartbeat200ResponseData.php
 lib/Model/GetApiV3Heartbeat200ResponseData.php
 lib/Model/GetApiV3Me200Response.php
 lib/Model/GetApiV3Me200Response.php
@@ -242,6 +266,8 @@ lib/Model/GetApiV3MeAgentThreads200Response.php
 lib/Model/GetApiV3MeAgentThreads200ResponseDataInner.php
 lib/Model/GetApiV3MeAgentThreads200ResponseDataInner.php
 lib/Model/GetApiV3MeAgentThreads200ResponseDataInnerRunsInner.php
 lib/Model/GetApiV3MeAgentThreads200ResponseDataInnerRunsInner.php
 lib/Model/GetApiV3MeAgentThreadsThread200Response.php
 lib/Model/GetApiV3MeAgentThreadsThread200Response.php
+lib/Model/GetApiV3MeGroups200Response.php
+lib/Model/GetApiV3MeGroups200ResponseDataInner.php
 lib/Model/GetApiV3MeReactions200Response.php
 lib/Model/GetApiV3MeReactions200Response.php
 lib/Model/GetApiV3MeReactions200ResponseDataInner.php
 lib/Model/GetApiV3MeReactions200ResponseDataInner.php
 lib/Model/GetApiV3PasswordResetsToken200Response.php
 lib/Model/GetApiV3PasswordResetsToken200Response.php
@@ -274,6 +300,8 @@ lib/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseDataInner
 lib/Model/ModelInterface.php
 lib/Model/ModelInterface.php
 lib/Model/PaginationMeta.php
 lib/Model/PaginationMeta.php
 lib/Model/PatchApiV3DiscussionsDiscussionRequest.php
 lib/Model/PatchApiV3DiscussionsDiscussionRequest.php
+lib/Model/PatchApiV3GroupsGroupMembersMemberRequest.php
+lib/Model/PatchApiV3GroupsGroupRequest.php
 lib/Model/PatchApiV3MeAgentThreadsThreadRequest.php
 lib/Model/PatchApiV3MeAgentThreadsThreadRequest.php
 lib/Model/PatchApiV3PasswordResetsTokenRequest.php
 lib/Model/PatchApiV3PasswordResetsTokenRequest.php
 lib/Model/PostApiV3AgentCharges200Response.php
 lib/Model/PostApiV3AgentCharges200Response.php
@@ -299,6 +327,10 @@ lib/Model/PostApiV3DiscussionsBatchCountRequestTargetsInner.php
 lib/Model/PostApiV3DiscussionsDiscussionRepliesRequest.php
 lib/Model/PostApiV3DiscussionsDiscussionRepliesRequest.php
 lib/Model/PostApiV3DiscussionsRequest.php
 lib/Model/PostApiV3DiscussionsRequest.php
 lib/Model/PostApiV3EmailCertificationsRequest.php
 lib/Model/PostApiV3EmailCertificationsRequest.php
+lib/Model/PostApiV3Groups200Response.php
+lib/Model/PostApiV3GroupsGroupMembers200Response.php
+lib/Model/PostApiV3GroupsGroupMembersRequest.php
+lib/Model/PostApiV3GroupsRequest.php
 lib/Model/PostApiV3Invites200Response.php
 lib/Model/PostApiV3Invites200Response.php
 lib/Model/PostApiV3Invites200ResponseData.php
 lib/Model/PostApiV3Invites200ResponseData.php
 lib/Model/PostApiV3InvitesRequest.php
 lib/Model/PostApiV3InvitesRequest.php
@@ -329,6 +361,7 @@ test/Api/AgentTracesApiTest.php
 test/Api/CreditPolicyApiTest.php
 test/Api/CreditPolicyApiTest.php
 test/Api/DiscussionsApiTest.php
 test/Api/DiscussionsApiTest.php
 test/Api/EmailCertificationsApiTest.php
 test/Api/EmailCertificationsApiTest.php
+test/Api/GroupsApiTest.php
 test/Api/HeartbeatApiTest.php
 test/Api/HeartbeatApiTest.php
 test/Api/InvitesApiTest.php
 test/Api/InvitesApiTest.php
 test/Api/MeApiTest.php
 test/Api/MeApiTest.php
@@ -390,6 +423,13 @@ test/Model/GetApiV3Discussions200ResponseTest.php
 test/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCountsTest.php
 test/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCountsTest.php
 test/Model/GetApiV3DiscussionsSummary200ResponseDataTest.php
 test/Model/GetApiV3DiscussionsSummary200ResponseDataTest.php
 test/Model/GetApiV3DiscussionsSummary200ResponseTest.php
 test/Model/GetApiV3DiscussionsSummary200ResponseTest.php
+test/Model/GetApiV3Groups200ResponseDataInnerTest.php
+test/Model/GetApiV3Groups200ResponseTest.php
+test/Model/GetApiV3GroupsGroupMembers200ResponseDataInnerTest.php
+test/Model/GetApiV3GroupsGroupMembers200ResponseTest.php
+test/Model/GetApiV3GroupsGroupShares200ResponseDataInnerResourceTest.php
+test/Model/GetApiV3GroupsGroupShares200ResponseDataInnerTest.php
+test/Model/GetApiV3GroupsGroupShares200ResponseTest.php
 test/Model/GetApiV3Heartbeat200ResponseDataTest.php
 test/Model/GetApiV3Heartbeat200ResponseDataTest.php
 test/Model/GetApiV3Heartbeat200ResponseTest.php
 test/Model/GetApiV3Heartbeat200ResponseTest.php
 test/Model/GetApiV3Me200ResponseDataTest.php
 test/Model/GetApiV3Me200ResponseDataTest.php
@@ -398,6 +438,8 @@ test/Model/GetApiV3MeAgentThreads200ResponseDataInnerRunsInnerTest.php
 test/Model/GetApiV3MeAgentThreads200ResponseDataInnerTest.php
 test/Model/GetApiV3MeAgentThreads200ResponseDataInnerTest.php
 test/Model/GetApiV3MeAgentThreads200ResponseTest.php
 test/Model/GetApiV3MeAgentThreads200ResponseTest.php
 test/Model/GetApiV3MeAgentThreadsThread200ResponseTest.php
 test/Model/GetApiV3MeAgentThreadsThread200ResponseTest.php
+test/Model/GetApiV3MeGroups200ResponseDataInnerTest.php
+test/Model/GetApiV3MeGroups200ResponseTest.php
 test/Model/GetApiV3MeReactions200ResponseDataInnerTest.php
 test/Model/GetApiV3MeReactions200ResponseDataInnerTest.php
 test/Model/GetApiV3MeReactions200ResponseTest.php
 test/Model/GetApiV3MeReactions200ResponseTest.php
 test/Model/GetApiV3PasswordResetsToken200ResponseDataTest.php
 test/Model/GetApiV3PasswordResetsToken200ResponseDataTest.php
@@ -429,6 +471,8 @@ test/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseDataInne
 test/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseTest.php
 test/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseTest.php
 test/Model/PaginationMetaTest.php
 test/Model/PaginationMetaTest.php
 test/Model/PatchApiV3DiscussionsDiscussionRequestTest.php
 test/Model/PatchApiV3DiscussionsDiscussionRequestTest.php
+test/Model/PatchApiV3GroupsGroupMembersMemberRequestTest.php
+test/Model/PatchApiV3GroupsGroupRequestTest.php
 test/Model/PatchApiV3MeAgentThreadsThreadRequestTest.php
 test/Model/PatchApiV3MeAgentThreadsThreadRequestTest.php
 test/Model/PatchApiV3PasswordResetsTokenRequestTest.php
 test/Model/PatchApiV3PasswordResetsTokenRequestTest.php
 test/Model/PostApiV3AgentCharges200ResponseDataTest.php
 test/Model/PostApiV3AgentCharges200ResponseDataTest.php
@@ -454,6 +498,10 @@ test/Model/PostApiV3DiscussionsBatchCountRequestTest.php
 test/Model/PostApiV3DiscussionsDiscussionRepliesRequestTest.php
 test/Model/PostApiV3DiscussionsDiscussionRepliesRequestTest.php
 test/Model/PostApiV3DiscussionsRequestTest.php
 test/Model/PostApiV3DiscussionsRequestTest.php
 test/Model/PostApiV3EmailCertificationsRequestTest.php
 test/Model/PostApiV3EmailCertificationsRequestTest.php
+test/Model/PostApiV3Groups200ResponseTest.php
+test/Model/PostApiV3GroupsGroupMembers200ResponseTest.php
+test/Model/PostApiV3GroupsGroupMembersRequestTest.php
+test/Model/PostApiV3GroupsRequestTest.php
 test/Model/PostApiV3Invites200ResponseDataTest.php
 test/Model/PostApiV3Invites200ResponseDataTest.php
 test/Model/PostApiV3Invites200ResponseTest.php
 test/Model/PostApiV3Invites200ResponseTest.php
 test/Model/PostApiV3InvitesRequestTest.php
 test/Model/PostApiV3InvitesRequestTest.php

+ 6 - 6
api-test/client/lib/Api/AdminApi.php

@@ -14,7 +14,7 @@
  *
  *
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  *
  *
- * The version of the OpenAPI document: 2026.11.12
+ * The version of the OpenAPI document: 1.0.0
  * Generated by: https://openapi-generator.tech
  * Generated by: https://openapi-generator.tech
  * Generator version: 7.25.0
  * Generator version: 7.25.0
  */
  */
@@ -536,7 +536,7 @@ class AdminApi
      *
      *
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  string|null $filter_status 运行结果 (optional)
      * @param  string|null $filter_status 运行结果 (optional)
-     * @param  string|null $filter_route 研究路径(question / term / passage / chat) (optional)
+     * @param  string|null $filter_route 研究路径:question 一般问题 / term 术语与词 / passage 阅读页提问 / chat 闲聊 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
@@ -561,7 +561,7 @@ class AdminApi
      *
      *
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  string|null $filter_status 运行结果 (optional)
      * @param  string|null $filter_status 运行结果 (optional)
-     * @param  string|null $filter_route 研究路径(question / term / passage / chat) (optional)
+     * @param  string|null $filter_route 研究路径:question 一般问题 / term 术语与词 / passage 阅读页提问 / chat 闲聊 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
@@ -681,7 +681,7 @@ class AdminApi
      *
      *
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  string|null $filter_status 运行结果 (optional)
      * @param  string|null $filter_status 运行结果 (optional)
-     * @param  string|null $filter_route 研究路径(question / term / passage / chat) (optional)
+     * @param  string|null $filter_route 研究路径:question 一般问题 / term 术语与词 / passage 阅读页提问 / chat 闲聊 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
@@ -709,7 +709,7 @@ class AdminApi
      *
      *
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  string|null $filter_status 运行结果 (optional)
      * @param  string|null $filter_status 运行结果 (optional)
-     * @param  string|null $filter_route 研究路径(question / term / passage / chat) (optional)
+     * @param  string|null $filter_route 研究路径:question 一般问题 / term 术语与词 / passage 阅读页提问 / chat 闲聊 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
@@ -766,7 +766,7 @@ class AdminApi
      *
      *
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  int|null $per_page 每页数量,最大 100 (optional, default to 20)
      * @param  string|null $filter_status 运行结果 (optional)
      * @param  string|null $filter_status 运行结果 (optional)
-     * @param  string|null $filter_route 研究路径(question / term / passage / chat) (optional)
+     * @param  string|null $filter_route 研究路径:question 一般问题 / term 术语与词 / passage 阅读页提问 / chat 闲聊 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_account_type 账号类型 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  string|null $filter_client 客户端 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)
      * @param  bool|null $filter_improve 是否允许用于改进回答 (optional)

+ 4067 - 0
api-test/client/lib/Api/GroupsApi.php

@@ -0,0 +1,4067 @@
+<?php
+/**
+ * GroupsApi
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use WikipaliApi\ApiException;
+use WikipaliApi\Configuration;
+use WikipaliApi\FormDataProcessor;
+use WikipaliApi\HeaderSelector;
+use WikipaliApi\ObjectSerializer;
+
+/**
+ * GroupsApi Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+class GroupsApi
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $client;
+
+    /**
+     * @var Configuration
+     */
+    protected $config;
+
+    /**
+     * @var HeaderSelector
+     */
+    protected $headerSelector;
+
+    /**
+     * @var int Host index
+     */
+    protected $hostIndex;
+
+    /** @var string[] $contentTypes **/
+    public const contentTypes = [
+        'deleteApiV3GroupsGroup' => [
+            'application/json',
+        ],
+        'deleteApiV3GroupsGroupMembersMember' => [
+            'application/json',
+        ],
+        'deleteApiV3GroupsGroupSharesShare' => [
+            'application/json',
+        ],
+        'getApiV3Groups' => [
+            'application/json',
+        ],
+        'getApiV3GroupsGroup' => [
+            'application/json',
+        ],
+        'getApiV3GroupsGroupMembers' => [
+            'application/json',
+        ],
+        'getApiV3GroupsGroupShares' => [
+            'application/json',
+        ],
+        'getApiV3MeGroups' => [
+            'application/json',
+        ],
+        'patchApiV3GroupsGroup' => [
+            'application/json',
+        ],
+        'patchApiV3GroupsGroupMembersMember' => [
+            'application/json',
+        ],
+        'postApiV3Groups' => [
+            'application/json',
+        ],
+        'postApiV3GroupsGroupMembers' => [
+            'application/json',
+        ],
+    ];
+
+    /**
+     * @param ClientInterface $client
+     * @param Configuration   $config
+     * @param HeaderSelector  $selector
+     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+     */
+    public function __construct(
+        ?ClientInterface $client = null,
+        ?Configuration $config = null,
+        ?HeaderSelector $selector = null,
+        int $hostIndex = 0
+    ) {
+        $this->client = $client ?: new Client();
+        $this->config = $config ?: Configuration::getDefaultConfiguration();
+        $this->headerSelector = $selector ?: new HeaderSelector();
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Set the host index
+     *
+     * @param int $hostIndex Host index (required)
+     */
+    public function setHostIndex($hostIndex): void
+    {
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Get the host index
+     *
+     * @return int Host index
+     */
+    public function getHostIndex()
+    {
+        return $this->hostIndex;
+    }
+
+    /**
+     * @return Configuration
+     */
+    public function getConfig()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroup
+     *
+     * 删团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return void
+     */
+    public function deleteApiV3GroupsGroup($group, string $contentType = self::contentTypes['deleteApiV3GroupsGroup'][0])
+    {
+        $this->deleteApiV3GroupsGroupWithHttpInfo($group, $contentType);
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupWithHttpInfo
+     *
+     * 删团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of null, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function deleteApiV3GroupsGroupWithHttpInfo($group, string $contentType = self::contentTypes['deleteApiV3GroupsGroup'][0])
+    {
+        $request = $this->deleteApiV3GroupsGroupRequest($group, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            return [null, $statusCode, $response->getHeaders()];
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 409:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupAsync
+     *
+     * 删团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function deleteApiV3GroupsGroupAsync($group, string $contentType = self::contentTypes['deleteApiV3GroupsGroup'][0])
+    {
+        return $this->deleteApiV3GroupsGroupAsyncWithHttpInfo($group, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupAsyncWithHttpInfo
+     *
+     * 删团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function deleteApiV3GroupsGroupAsyncWithHttpInfo($group, string $contentType = self::contentTypes['deleteApiV3GroupsGroup'][0])
+    {
+        $returnType = '';
+        $request = $this->deleteApiV3GroupsGroupRequest($group, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    return [null, $response->getStatusCode(), $response->getHeaders()];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'deleteApiV3GroupsGroup'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function deleteApiV3GroupsGroupRequest($group, string $contentType = self::contentTypes['deleteApiV3GroupsGroup'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling deleteApiV3GroupsGroup'
+            );
+        }
+
+
+        $resourcePath = '/v3/groups/{group}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'DELETE',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupMembersMember
+     *
+     * 移除成员 / 退出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return void
+     */
+    public function deleteApiV3GroupsGroupMembersMember($group, $member, string $contentType = self::contentTypes['deleteApiV3GroupsGroupMembersMember'][0])
+    {
+        $this->deleteApiV3GroupsGroupMembersMemberWithHttpInfo($group, $member, $contentType);
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupMembersMemberWithHttpInfo
+     *
+     * 移除成员 / 退出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of null, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function deleteApiV3GroupsGroupMembersMemberWithHttpInfo($group, $member, string $contentType = self::contentTypes['deleteApiV3GroupsGroupMembersMember'][0])
+    {
+        $request = $this->deleteApiV3GroupsGroupMembersMemberRequest($group, $member, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            return [null, $statusCode, $response->getHeaders()];
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupMembersMemberAsync
+     *
+     * 移除成员 / 退出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function deleteApiV3GroupsGroupMembersMemberAsync($group, $member, string $contentType = self::contentTypes['deleteApiV3GroupsGroupMembersMember'][0])
+    {
+        return $this->deleteApiV3GroupsGroupMembersMemberAsyncWithHttpInfo($group, $member, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupMembersMemberAsyncWithHttpInfo
+     *
+     * 移除成员 / 退出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function deleteApiV3GroupsGroupMembersMemberAsyncWithHttpInfo($group, $member, string $contentType = self::contentTypes['deleteApiV3GroupsGroupMembersMember'][0])
+    {
+        $returnType = '';
+        $request = $this->deleteApiV3GroupsGroupMembersMemberRequest($group, $member, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    return [null, $response->getStatusCode(), $response->getHeaders()];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'deleteApiV3GroupsGroupMembersMember'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function deleteApiV3GroupsGroupMembersMemberRequest($group, $member, string $contentType = self::contentTypes['deleteApiV3GroupsGroupMembersMember'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling deleteApiV3GroupsGroupMembersMember'
+            );
+        }
+
+        // verify the required parameter 'member' is set
+        if ($member === null || (is_array($member) && count($member) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $member when calling deleteApiV3GroupsGroupMembersMember'
+            );
+        }
+
+
+        $resourcePath = '/v3/groups/{group}/members/{member}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+        // path params
+        if ($member !== null) {
+            $resourcePath = str_replace(
+                '{member}',
+                ObjectSerializer::toPathValue($member),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'DELETE',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupSharesShare
+     *
+     * 把资源移出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $share 共享记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupSharesShare'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return void
+     */
+    public function deleteApiV3GroupsGroupSharesShare($group, $share, string $contentType = self::contentTypes['deleteApiV3GroupsGroupSharesShare'][0])
+    {
+        $this->deleteApiV3GroupsGroupSharesShareWithHttpInfo($group, $share, $contentType);
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupSharesShareWithHttpInfo
+     *
+     * 把资源移出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $share 共享记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupSharesShare'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of null, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function deleteApiV3GroupsGroupSharesShareWithHttpInfo($group, $share, string $contentType = self::contentTypes['deleteApiV3GroupsGroupSharesShare'][0])
+    {
+        $request = $this->deleteApiV3GroupsGroupSharesShareRequest($group, $share, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            return [null, $statusCode, $response->getHeaders()];
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupSharesShareAsync
+     *
+     * 把资源移出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $share 共享记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupSharesShare'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function deleteApiV3GroupsGroupSharesShareAsync($group, $share, string $contentType = self::contentTypes['deleteApiV3GroupsGroupSharesShare'][0])
+    {
+        return $this->deleteApiV3GroupsGroupSharesShareAsyncWithHttpInfo($group, $share, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation deleteApiV3GroupsGroupSharesShareAsyncWithHttpInfo
+     *
+     * 把资源移出团队
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $share 共享记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupSharesShare'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function deleteApiV3GroupsGroupSharesShareAsyncWithHttpInfo($group, $share, string $contentType = self::contentTypes['deleteApiV3GroupsGroupSharesShare'][0])
+    {
+        $returnType = '';
+        $request = $this->deleteApiV3GroupsGroupSharesShareRequest($group, $share, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    return [null, $response->getStatusCode(), $response->getHeaders()];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'deleteApiV3GroupsGroupSharesShare'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $share 共享记录 id (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiV3GroupsGroupSharesShare'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function deleteApiV3GroupsGroupSharesShareRequest($group, $share, string $contentType = self::contentTypes['deleteApiV3GroupsGroupSharesShare'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling deleteApiV3GroupsGroupSharesShare'
+            );
+        }
+
+        // verify the required parameter 'share' is set
+        if ($share === null || (is_array($share) && count($share) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $share when calling deleteApiV3GroupsGroupSharesShare'
+            );
+        }
+
+
+        $resourcePath = '/v3/groups/{group}/shares/{share}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+        // path params
+        if ($share !== null) {
+            $resourcePath = str_replace(
+                '{share}',
+                ObjectSerializer::toPathValue($share),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'DELETE',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation getApiV3Groups
+     *
+     * 搜公开团队
+     *
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\GetApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3Groups($per_page = 20, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3Groups'][0])
+    {
+        list($response) = $this->getApiV3GroupsWithHttpInfo($per_page, $search, $page, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3GroupsWithHttpInfo
+     *
+     * 搜公开团队
+     *
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\GetApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3GroupsWithHttpInfo($per_page = 20, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3Groups'][0])
+    {
+        $request = $this->getApiV3GroupsRequest($per_page, $search, $page, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3Groups200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3Groups200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3Groups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3GroupsAsync
+     *
+     * 搜公开团队
+     *
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsAsync($per_page = 20, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3Groups'][0])
+    {
+        return $this->getApiV3GroupsAsyncWithHttpInfo($per_page, $search, $page, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3GroupsAsyncWithHttpInfo
+     *
+     * 搜公开团队
+     *
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsAsyncWithHttpInfo($per_page = 20, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3Groups'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3Groups200Response';
+        $request = $this->getApiV3GroupsRequest($per_page, $search, $page, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3Groups'
+     *
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3GroupsRequest($per_page = 20, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3Groups'][0])
+    {
+
+
+
+
+
+        $resourcePath = '/v3/groups';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $per_page,
+            'per_page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $search,
+            'search', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $page,
+            'page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation getApiV3GroupsGroup
+     *
+     * 团队详情
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3GroupsGroup($group, string $contentType = self::contentTypes['getApiV3GroupsGroup'][0])
+    {
+        list($response) = $this->getApiV3GroupsGroupWithHttpInfo($group, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupWithHttpInfo
+     *
+     * 团队详情
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3GroupsGroupWithHttpInfo($group, string $contentType = self::contentTypes['getApiV3GroupsGroup'][0])
+    {
+        $request = $this->getApiV3GroupsGroupRequest($group, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\PostApiV3Groups200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupAsync
+     *
+     * 团队详情
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsGroupAsync($group, string $contentType = self::contentTypes['getApiV3GroupsGroup'][0])
+    {
+        return $this->getApiV3GroupsGroupAsyncWithHttpInfo($group, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupAsyncWithHttpInfo
+     *
+     * 团队详情
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsGroupAsyncWithHttpInfo($group, string $contentType = self::contentTypes['getApiV3GroupsGroup'][0])
+    {
+        $returnType = '\WikipaliApi\Model\PostApiV3Groups200Response';
+        $request = $this->getApiV3GroupsGroupRequest($group, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3GroupsGroup'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3GroupsGroupRequest($group, string $contentType = self::contentTypes['getApiV3GroupsGroup'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling getApiV3GroupsGroup'
+            );
+        }
+
+
+        $resourcePath = '/v3/groups/{group}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupMembers
+     *
+     * 列出团队成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\GetApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3GroupsGroupMembers($group, $per_page = 100, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupMembers'][0])
+    {
+        list($response) = $this->getApiV3GroupsGroupMembersWithHttpInfo($group, $per_page, $page, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupMembersWithHttpInfo
+     *
+     * 列出团队成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\GetApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3GroupsGroupMembersWithHttpInfo($group, $per_page = 100, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupMembers'][0])
+    {
+        $request = $this->getApiV3GroupsGroupMembersRequest($group, $per_page, $page, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3GroupsGroupMembers200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3GroupsGroupMembers200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3GroupsGroupMembers200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupMembersAsync
+     *
+     * 列出团队成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsGroupMembersAsync($group, $per_page = 100, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupMembers'][0])
+    {
+        return $this->getApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $per_page, $page, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupMembersAsyncWithHttpInfo
+     *
+     * 列出团队成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $per_page = 100, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupMembers'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3GroupsGroupMembers200Response';
+        $request = $this->getApiV3GroupsGroupMembersRequest($group, $per_page, $page, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3GroupsGroupMembers'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3GroupsGroupMembersRequest($group, $per_page = 100, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupMembers'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling getApiV3GroupsGroupMembers'
+            );
+        }
+
+
+
+
+        $resourcePath = '/v3/groups/{group}/members';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $per_page,
+            'per_page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $page,
+            'page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupShares
+     *
+     * 列出团队文档
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupShares'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\GetApiV3GroupsGroupShares200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3GroupsGroupShares($group, $per_page = 20, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupShares'][0])
+    {
+        list($response) = $this->getApiV3GroupsGroupSharesWithHttpInfo($group, $per_page, $page, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupSharesWithHttpInfo
+     *
+     * 列出团队文档
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupShares'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\GetApiV3GroupsGroupShares200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3GroupsGroupSharesWithHttpInfo($group, $per_page = 20, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupShares'][0])
+    {
+        $request = $this->getApiV3GroupsGroupSharesRequest($group, $per_page, $page, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3GroupsGroupShares200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3GroupsGroupShares200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3GroupsGroupShares200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupSharesAsync
+     *
+     * 列出团队文档
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupShares'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsGroupSharesAsync($group, $per_page = 20, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupShares'][0])
+    {
+        return $this->getApiV3GroupsGroupSharesAsyncWithHttpInfo($group, $per_page, $page, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3GroupsGroupSharesAsyncWithHttpInfo
+     *
+     * 列出团队文档
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupShares'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupsGroupSharesAsyncWithHttpInfo($group, $per_page = 20, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupShares'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3GroupsGroupShares200Response';
+        $request = $this->getApiV3GroupsGroupSharesRequest($group, $per_page, $page, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3GroupsGroupShares'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 20)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupsGroupShares'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3GroupsGroupSharesRequest($group, $per_page = 20, $page = 1, string $contentType = self::contentTypes['getApiV3GroupsGroupShares'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling getApiV3GroupsGroupShares'
+            );
+        }
+
+
+
+
+        $resourcePath = '/v3/groups/{group}/shares';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $per_page,
+            'per_page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $page,
+            'page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation getApiV3MeGroups
+     *
+     * 列出我加入的团队
+     *
+     * @param  bool|null $owned true 只列我创建的,false 只列我参加的别人的团队;不传列全部 (optional)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\GetApiV3MeGroups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3MeGroups($owned = null, $per_page = 100, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3MeGroups'][0])
+    {
+        list($response) = $this->getApiV3MeGroupsWithHttpInfo($owned, $per_page, $search, $page, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3MeGroupsWithHttpInfo
+     *
+     * 列出我加入的团队
+     *
+     * @param  bool|null $owned true 只列我创建的,false 只列我参加的别人的团队;不传列全部 (optional)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\GetApiV3MeGroups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3MeGroupsWithHttpInfo($owned = null, $per_page = 100, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3MeGroups'][0])
+    {
+        $request = $this->getApiV3MeGroupsRequest($owned, $per_page, $search, $page, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3MeGroups200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3MeGroups200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3MeGroups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3MeGroupsAsync
+     *
+     * 列出我加入的团队
+     *
+     * @param  bool|null $owned true 只列我创建的,false 只列我参加的别人的团队;不传列全部 (optional)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3MeGroupsAsync($owned = null, $per_page = 100, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3MeGroups'][0])
+    {
+        return $this->getApiV3MeGroupsAsyncWithHttpInfo($owned, $per_page, $search, $page, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3MeGroupsAsyncWithHttpInfo
+     *
+     * 列出我加入的团队
+     *
+     * @param  bool|null $owned true 只列我创建的,false 只列我参加的别人的团队;不传列全部 (optional)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3MeGroupsAsyncWithHttpInfo($owned = null, $per_page = 100, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3MeGroups'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3MeGroups200Response';
+        $request = $this->getApiV3MeGroupsRequest($owned, $per_page, $search, $page, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3MeGroups'
+     *
+     * @param  bool|null $owned true 只列我创建的,false 只列我参加的别人的团队;不传列全部 (optional)
+     * @param  int|null $per_page 每页数量,最大 200 (optional, default to 100)
+     * @param  string|null $search 按团队名模糊匹配 (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3MeGroupsRequest($owned = null, $per_page = 100, $search = null, $page = 1, string $contentType = self::contentTypes['getApiV3MeGroups'][0])
+    {
+
+
+
+
+
+
+        $resourcePath = '/v3/me/groups';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $owned,
+            'owned', // param base name
+            'boolean', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $per_page,
+            'per_page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $search,
+            'search', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $page,
+            'page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroup
+     *
+     * 改团队信息
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupRequest|null $patch_api_v3_groups_group_request patch_api_v3_groups_group_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function patchApiV3GroupsGroup($group, $patch_api_v3_groups_group_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroup'][0])
+    {
+        list($response) = $this->patchApiV3GroupsGroupWithHttpInfo($group, $patch_api_v3_groups_group_request, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroupWithHttpInfo
+     *
+     * 改团队信息
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupRequest|null $patch_api_v3_groups_group_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function patchApiV3GroupsGroupWithHttpInfo($group, $patch_api_v3_groups_group_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroup'][0])
+    {
+        $request = $this->patchApiV3GroupsGroupRequest($group, $patch_api_v3_groups_group_request, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\PostApiV3Groups200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroupAsync
+     *
+     * 改团队信息
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupRequest|null $patch_api_v3_groups_group_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function patchApiV3GroupsGroupAsync($group, $patch_api_v3_groups_group_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroup'][0])
+    {
+        return $this->patchApiV3GroupsGroupAsyncWithHttpInfo($group, $patch_api_v3_groups_group_request, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroupAsyncWithHttpInfo
+     *
+     * 改团队信息
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupRequest|null $patch_api_v3_groups_group_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function patchApiV3GroupsGroupAsyncWithHttpInfo($group, $patch_api_v3_groups_group_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroup'][0])
+    {
+        $returnType = '\WikipaliApi\Model\PostApiV3Groups200Response';
+        $request = $this->patchApiV3GroupsGroupRequest($group, $patch_api_v3_groups_group_request, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'patchApiV3GroupsGroup'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupRequest|null $patch_api_v3_groups_group_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroup'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function patchApiV3GroupsGroupRequest($group, $patch_api_v3_groups_group_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroup'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling patchApiV3GroupsGroup'
+            );
+        }
+
+
+
+        $resourcePath = '/v3/groups/{group}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (isset($patch_api_v3_groups_group_request)) {
+            if (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the body
+                try {
+                    $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($patch_api_v3_groups_group_request), JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                $httpBody = $patch_api_v3_groups_group_request;
+            }
+        } elseif (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'PATCH',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroupMembersMember
+     *
+     * 改成员角色
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest|null $patch_api_v3_groups_group_members_member_request patch_api_v3_groups_group_members_member_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function patchApiV3GroupsGroupMembersMember($group, $member, $patch_api_v3_groups_group_members_member_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroupMembersMember'][0])
+    {
+        list($response) = $this->patchApiV3GroupsGroupMembersMemberWithHttpInfo($group, $member, $patch_api_v3_groups_group_members_member_request, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroupMembersMemberWithHttpInfo
+     *
+     * 改成员角色
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest|null $patch_api_v3_groups_group_members_member_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function patchApiV3GroupsGroupMembersMemberWithHttpInfo($group, $member, $patch_api_v3_groups_group_members_member_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroupMembersMember'][0])
+    {
+        $request = $this->patchApiV3GroupsGroupMembersMemberRequest($group, $member, $patch_api_v3_groups_group_members_member_request, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroupMembersMemberAsync
+     *
+     * 改成员角色
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest|null $patch_api_v3_groups_group_members_member_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function patchApiV3GroupsGroupMembersMemberAsync($group, $member, $patch_api_v3_groups_group_members_member_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroupMembersMember'][0])
+    {
+        return $this->patchApiV3GroupsGroupMembersMemberAsyncWithHttpInfo($group, $member, $patch_api_v3_groups_group_members_member_request, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation patchApiV3GroupsGroupMembersMemberAsyncWithHttpInfo
+     *
+     * 改成员角色
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest|null $patch_api_v3_groups_group_members_member_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function patchApiV3GroupsGroupMembersMemberAsyncWithHttpInfo($group, $member, $patch_api_v3_groups_group_members_member_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroupMembersMember'][0])
+    {
+        $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response';
+        $request = $this->patchApiV3GroupsGroupMembersMemberRequest($group, $member, $patch_api_v3_groups_group_members_member_request, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'patchApiV3GroupsGroupMembersMember'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  string $member 成员记录 id (required)
+     * @param  \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest|null $patch_api_v3_groups_group_members_member_request (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['patchApiV3GroupsGroupMembersMember'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function patchApiV3GroupsGroupMembersMemberRequest($group, $member, $patch_api_v3_groups_group_members_member_request = null, string $contentType = self::contentTypes['patchApiV3GroupsGroupMembersMember'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling patchApiV3GroupsGroupMembersMember'
+            );
+        }
+
+        // verify the required parameter 'member' is set
+        if ($member === null || (is_array($member) && count($member) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $member when calling patchApiV3GroupsGroupMembersMember'
+            );
+        }
+
+
+
+        $resourcePath = '/v3/groups/{group}/members/{member}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+        // path params
+        if ($member !== null) {
+            $resourcePath = str_replace(
+                '{member}',
+                ObjectSerializer::toPathValue($member),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (isset($patch_api_v3_groups_group_members_member_request)) {
+            if (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the body
+                try {
+                    $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($patch_api_v3_groups_group_members_member_request), JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                $httpBody = $patch_api_v3_groups_group_members_member_request;
+            }
+        } elseif (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'PATCH',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation postApiV3Groups
+     *
+     * 建团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3GroupsRequest $post_api_v3_groups_request post_api_v3_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function postApiV3Groups($post_api_v3_groups_request, string $contentType = self::contentTypes['postApiV3Groups'][0])
+    {
+        list($response) = $this->postApiV3GroupsWithHttpInfo($post_api_v3_groups_request, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation postApiV3GroupsWithHttpInfo
+     *
+     * 建团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3GroupsRequest $post_api_v3_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\PostApiV3Groups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function postApiV3GroupsWithHttpInfo($post_api_v3_groups_request, string $contentType = self::contentTypes['postApiV3Groups'][0])
+    {
+        $request = $this->postApiV3GroupsRequest($post_api_v3_groups_request, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $request,
+                        $response,
+                    );
+                case 201:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\PostApiV3Groups200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 201:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3Groups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation postApiV3GroupsAsync
+     *
+     * 建团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3GroupsRequest $post_api_v3_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3GroupsAsync($post_api_v3_groups_request, string $contentType = self::contentTypes['postApiV3Groups'][0])
+    {
+        return $this->postApiV3GroupsAsyncWithHttpInfo($post_api_v3_groups_request, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation postApiV3GroupsAsyncWithHttpInfo
+     *
+     * 建团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3GroupsRequest $post_api_v3_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3GroupsAsyncWithHttpInfo($post_api_v3_groups_request, string $contentType = self::contentTypes['postApiV3Groups'][0])
+    {
+        $returnType = '\WikipaliApi\Model\PostApiV3Groups200Response';
+        $request = $this->postApiV3GroupsRequest($post_api_v3_groups_request, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'postApiV3Groups'
+     *
+     * @param  \WikipaliApi\Model\PostApiV3GroupsRequest $post_api_v3_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3Groups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function postApiV3GroupsRequest($post_api_v3_groups_request, string $contentType = self::contentTypes['postApiV3Groups'][0])
+    {
+
+        // verify the required parameter 'post_api_v3_groups_request' is set
+        if ($post_api_v3_groups_request === null || (is_array($post_api_v3_groups_request) && count($post_api_v3_groups_request) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $post_api_v3_groups_request when calling postApiV3Groups'
+            );
+        }
+
+
+        $resourcePath = '/v3/groups';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (isset($post_api_v3_groups_request)) {
+            if (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the body
+                try {
+                    $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_groups_request), JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                $httpBody = $post_api_v3_groups_request;
+            }
+        } elseif (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'POST',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembers
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function postApiV3GroupsGroupMembers($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        list($response) = $this->postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembersWithHttpInfo
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $request,
+                        $response,
+                    );
+                case 201:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 201:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembersAsync
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3GroupsGroupMembersAsync($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        return $this->postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembersAsyncWithHttpInfo
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response';
+        $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'postApiV3GroupsGroupMembers'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling postApiV3GroupsGroupMembers'
+            );
+        }
+
+        // verify the required parameter 'post_api_v3_groups_group_members_request' is set
+        if ($post_api_v3_groups_group_members_request === null || (is_array($post_api_v3_groups_group_members_request) && count($post_api_v3_groups_group_members_request) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $post_api_v3_groups_group_members_request when calling postApiV3GroupsGroupMembers'
+            );
+        }
+
+
+        $resourcePath = '/v3/groups/{group}/members';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (isset($post_api_v3_groups_group_members_request)) {
+            if (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the body
+                try {
+                    $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_groups_group_members_request), JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                $httpBody = $post_api_v3_groups_group_members_request;
+            }
+        } elseif (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'POST',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Create http client option
+     *
+     * @throws \RuntimeException on file opening failure
+     * @return array of http client options
+     */
+    protected function createHttpClientOption()
+    {
+        $options = [];
+        if ($this->config->getDebug()) {
+            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+            if (!$options[RequestOptions::DEBUG]) {
+                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+            }
+        }
+
+        if ($this->config->getCertFile()) {
+            $options[RequestOptions::CERT] = $this->config->getCertFile();
+        }
+
+        if ($this->config->getKeyFile()) {
+            $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
+        }
+
+        return $options;
+    }
+
+    private function handleResponseWithDataType(
+        string $dataType,
+        RequestInterface $request,
+        ResponseInterface $response
+    ): array {
+        if ($dataType === '\SplFileObject') {
+            $content = $response->getBody(); //stream goes to serializer
+        } else {
+            $content = (string) $response->getBody();
+            if ($dataType !== 'string') {
+                try {
+                    $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $exception) {
+                    throw new ApiException(
+                        sprintf(
+                            'Error JSON decoding server response (%s)',
+                            $request->getUri()
+                        ),
+                        $response->getStatusCode(),
+                        $response->getHeaders(),
+                        $content
+                    );
+                }
+            }
+        }
+
+        return [
+            ObjectSerializer::deserialize($content, $dataType, []),
+            $response->getStatusCode(),
+            $response->getHeaders()
+        ];
+    }
+
+    private function responseWithinRangeCode(
+        string $rangeCode,
+        int $statusCode
+    ): bool {
+        $left = (int) ($rangeCode[0].'00');
+        $right = (int) ($rangeCode[0].'99');
+
+        return $statusCode >= $left && $statusCode <= $right;
+    }
+}

+ 39 - 35
api-test/client/lib/Model/GetApiV3AdminAgentFeedback200ResponseDataInner.php

@@ -15,7 +15,7 @@
  *
  *
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  *
  *
- * The version of the OpenAPI document: 2026.11.12
+ * The version of the OpenAPI document: 1.0.0
  * Generated by: https://openapi-generator.tech
  * Generated by: https://openapi-generator.tech
  * Generator version: 7.25.0
  * Generator version: 7.25.0
  */
  */
@@ -57,7 +57,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
      * @var string[]
      * @var string[]
      */
      */
     protected static $openAPITypes = [
     protected static $openAPITypes = [
-        'id' => 'int',
         'message_id' => 'string',
         'message_id' => 'string',
         'rating' => 'int',
         'rating' => 'int',
         'tags' => 'string[]',
         'tags' => 'string[]',
@@ -82,7 +81,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
      * @psalm-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
      */
     protected static $openAPIFormats = [
     protected static $openAPIFormats = [
-        'id' => null,
         'message_id' => null,
         'message_id' => null,
         'rating' => null,
         'rating' => null,
         'tags' => null,
         'tags' => null,
@@ -105,7 +103,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
      * @var boolean[]
      * @var boolean[]
      */
      */
     protected static array $openAPINullables = [
     protected static array $openAPINullables = [
-        'id' => false,
         'message_id' => false,
         'message_id' => false,
         'rating' => false,
         'rating' => false,
         'tags' => false,
         'tags' => false,
@@ -208,7 +205,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
      * @var string[]
      * @var string[]
      */
      */
     protected static $attributeMap = [
     protected static $attributeMap = [
-        'id' => 'id',
         'message_id' => 'message_id',
         'message_id' => 'message_id',
         'rating' => 'rating',
         'rating' => 'rating',
         'tags' => 'tags',
         'tags' => 'tags',
@@ -231,7 +227,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
      * @var string[]
      * @var string[]
      */
      */
     protected static $setters = [
     protected static $setters = [
-        'id' => 'setId',
         'message_id' => 'setMessageId',
         'message_id' => 'setMessageId',
         'rating' => 'setRating',
         'rating' => 'setRating',
         'tags' => 'setTags',
         'tags' => 'setTags',
@@ -254,7 +249,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
      * @var string[]
      * @var string[]
      */
      */
     protected static $getters = [
     protected static $getters = [
-        'id' => 'getId',
         'message_id' => 'getMessageId',
         'message_id' => 'getMessageId',
         'rating' => 'getRating',
         'rating' => 'getRating',
         'tags' => 'getTags',
         'tags' => 'getTags',
@@ -312,6 +306,25 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
         return self::$openAPIModelName;
         return self::$openAPIModelName;
     }
     }
 
 
+    public const ROUTE_QUESTION = 'question';
+    public const ROUTE_TERM = 'term';
+    public const ROUTE_PASSAGE = 'passage';
+    public const ROUTE_CHAT = 'chat';
+
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getRouteAllowableValues()
+    {
+        return [
+            self::ROUTE_QUESTION,
+            self::ROUTE_TERM,
+            self::ROUTE_PASSAGE,
+            self::ROUTE_CHAT,
+        ];
+    }
 
 
     /**
     /**
      * Associative array for storing property values
      * Associative array for storing property values
@@ -328,7 +341,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
      */
      */
     public function __construct(?array $data = null)
     public function __construct(?array $data = null)
     {
     {
-        $this->setIfExists('id', $data ?? [], null);
         $this->setIfExists('message_id', $data ?? [], null);
         $this->setIfExists('message_id', $data ?? [], null);
         $this->setIfExists('rating', $data ?? [], null);
         $this->setIfExists('rating', $data ?? [], null);
         $this->setIfExists('tags', $data ?? [], null);
         $this->setIfExists('tags', $data ?? [], null);
@@ -372,6 +384,15 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
     {
     {
         $invalidProperties = [];
         $invalidProperties = [];
 
 
+        $allowedValues = $this->getRouteAllowableValues();
+        if (!is_null($this->container['route']) && !in_array($this->container['route'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'route', must be one of '%s'",
+                $this->container['route'],
+                implode("', '", $allowedValues)
+            );
+        }
+
         return $invalidProperties;
         return $invalidProperties;
     }
     }
 
 
@@ -387,33 +408,6 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
     }
     }
 
 
 
 
-    /**
-     * Gets id
-     *
-     * @return int|null
-     */
-    public function getId()
-    {
-        return $this->container['id'];
-    }
-
-    /**
-     * Sets id
-     *
-     * @param int|null $id id
-     *
-     * @return self
-     */
-    public function setId($id)
-    {
-        if (is_null($id)) {
-            throw new \InvalidArgumentException('non-nullable id cannot be null');
-        }
-        $this->container['id'] = $id;
-
-        return $this;
-    }
-
     /**
     /**
      * Gets message_id
      * Gets message_id
      *
      *
@@ -741,6 +735,16 @@ class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface,
                 $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
                 $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
             }
             }
         }
         }
+        $allowedValues = $this->getRouteAllowableValues();
+        if (!is_null($route) && !in_array($route, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'route', must be one of '%s'",
+                    $route,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
         $this->container['route'] = $route;
         $this->container['route'] = $route;
 
 
         return $this;
         return $this;

+ 73 - 1
api-test/client/lib/Model/GetApiV3AdminAgentRuns200ResponseDataInner.php

@@ -15,7 +15,7 @@
  *
  *
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  *
  *
- * The version of the OpenAPI document: 2026.11.12
+ * The version of the OpenAPI document: 1.0.0
  * Generated by: https://openapi-generator.tech
  * Generated by: https://openapi-generator.tech
  * Generator version: 7.25.0
  * Generator version: 7.25.0
  */
  */
@@ -396,6 +396,40 @@ class GetApiV3AdminAgentRuns200ResponseDataInner implements ModelInterface, Arra
         return self::$openAPIModelName;
         return self::$openAPIModelName;
     }
     }
 
 
+    public const ACCOUNT_TYPE_USER = 'user';
+    public const ACCOUNT_TYPE_GUEST = 'guest';
+    public const ROUTE_QUESTION = 'question';
+    public const ROUTE_TERM = 'term';
+    public const ROUTE_PASSAGE = 'passage';
+    public const ROUTE_CHAT = 'chat';
+
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getAccountTypeAllowableValues()
+    {
+        return [
+            self::ACCOUNT_TYPE_USER,
+            self::ACCOUNT_TYPE_GUEST,
+        ];
+    }
+
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getRouteAllowableValues()
+    {
+        return [
+            self::ROUTE_QUESTION,
+            self::ROUTE_TERM,
+            self::ROUTE_PASSAGE,
+            self::ROUTE_CHAT,
+        ];
+    }
 
 
     /**
     /**
      * Associative array for storing property values
      * Associative array for storing property values
@@ -470,6 +504,24 @@ class GetApiV3AdminAgentRuns200ResponseDataInner implements ModelInterface, Arra
     {
     {
         $invalidProperties = [];
         $invalidProperties = [];
 
 
+        $allowedValues = $this->getAccountTypeAllowableValues();
+        if (!is_null($this->container['account_type']) && !in_array($this->container['account_type'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'account_type', must be one of '%s'",
+                $this->container['account_type'],
+                implode("', '", $allowedValues)
+            );
+        }
+
+        $allowedValues = $this->getRouteAllowableValues();
+        if (!is_null($this->container['route']) && !in_array($this->container['route'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'route', must be one of '%s'",
+                $this->container['route'],
+                implode("', '", $allowedValues)
+            );
+        }
+
         return $invalidProperties;
         return $invalidProperties;
     }
     }
 
 
@@ -602,6 +654,16 @@ class GetApiV3AdminAgentRuns200ResponseDataInner implements ModelInterface, Arra
         if (is_null($account_type)) {
         if (is_null($account_type)) {
             throw new \InvalidArgumentException('non-nullable account_type cannot be null');
             throw new \InvalidArgumentException('non-nullable account_type cannot be null');
         }
         }
+        $allowedValues = $this->getAccountTypeAllowableValues();
+        if (!in_array($account_type, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'account_type', must be one of '%s'",
+                    $account_type,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
         $this->container['account_type'] = $account_type;
         $this->container['account_type'] = $account_type;
 
 
         return $this;
         return $this;
@@ -833,6 +895,16 @@ class GetApiV3AdminAgentRuns200ResponseDataInner implements ModelInterface, Arra
                 $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
                 $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
             }
             }
         }
         }
+        $allowedValues = $this->getRouteAllowableValues();
+        if (!is_null($route) && !in_array($route, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'route', must be one of '%s'",
+                    $route,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
         $this->container['route'] = $route;
         $this->container['route'] = $route;
 
 
         return $this;
         return $this;

+ 443 - 0
api-test/client/lib/Model/GetApiV3Groups200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3Groups200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3Groups200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3Groups200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_groups_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3Groups200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\PaginationMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3Groups200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3Groups200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\PaginationMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\PaginationMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 668 - 0
api-test/client/lib/Model/GetApiV3Groups200ResponseDataInner.php

@@ -0,0 +1,668 @@
+<?php
+/**
+ * GetApiV3Groups200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3Groups200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3Groups200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_groups_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'name' => 'string',
+        'description' => 'string',
+        'status' => 'int',
+        'owner' => '\WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser',
+        'role' => 'string',
+        'created_at' => 'string',
+        'updated_at' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'name' => null,
+        'description' => null,
+        'status' => null,
+        'owner' => null,
+        'role' => null,
+        'created_at' => null,
+        'updated_at' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'name' => false,
+        'description' => true,
+        'status' => false,
+        'owner' => true,
+        'role' => true,
+        'created_at' => false,
+        'updated_at' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'name' => 'name',
+        'description' => 'description',
+        'status' => 'status',
+        'owner' => 'owner',
+        'role' => 'role',
+        'created_at' => 'created_at',
+        'updated_at' => 'updated_at'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'name' => 'setName',
+        'description' => 'setDescription',
+        'status' => 'setStatus',
+        'owner' => 'setOwner',
+        'role' => 'setRole',
+        'created_at' => 'setCreatedAt',
+        'updated_at' => 'setUpdatedAt'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'name' => 'getName',
+        'description' => 'getDescription',
+        'status' => 'getStatus',
+        'owner' => 'getOwner',
+        'role' => 'getRole',
+        'created_at' => 'getCreatedAt',
+        'updated_at' => 'getUpdatedAt'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('name', $data ?? [], null);
+        $this->setIfExists('description', $data ?? [], null);
+        $this->setIfExists('status', $data ?? [], null);
+        $this->setIfExists('owner', $data ?? [], null);
+        $this->setIfExists('role', $data ?? [], null);
+        $this->setIfExists('created_at', $data ?? [], null);
+        $this->setIfExists('updated_at', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets name
+     *
+     * @return string|null
+     */
+    public function getName()
+    {
+        return $this->container['name'];
+    }
+
+    /**
+     * Sets name
+     *
+     * @param string|null $name name
+     *
+     * @return self
+     */
+    public function setName($name)
+    {
+        if (is_null($name)) {
+            throw new \InvalidArgumentException('non-nullable name cannot be null');
+        }
+        $this->container['name'] = $name;
+
+        return $this;
+    }
+
+    /**
+     * Gets description
+     *
+     * @return string|null
+     */
+    public function getDescription()
+    {
+        return $this->container['description'];
+    }
+
+    /**
+     * Sets description
+     *
+     * @param string|null $description description
+     *
+     * @return self
+     */
+    public function setDescription($description)
+    {
+        if (is_null($description)) {
+            array_push($this->openAPINullablesSetToNull, 'description');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('description', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['description'] = $description;
+
+        return $this;
+    }
+
+    /**
+     * Gets status
+     *
+     * @return int|null
+     */
+    public function getStatus()
+    {
+        return $this->container['status'];
+    }
+
+    /**
+     * Sets status
+     *
+     * @param int|null $status status
+     *
+     * @return self
+     */
+    public function setStatus($status)
+    {
+        if (is_null($status)) {
+            throw new \InvalidArgumentException('non-nullable status cannot be null');
+        }
+        $this->container['status'] = $status;
+
+        return $this;
+    }
+
+    /**
+     * Gets owner
+     *
+     * @return \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null
+     */
+    public function getOwner()
+    {
+        return $this->container['owner'];
+    }
+
+    /**
+     * Sets owner
+     *
+     * @param \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null $owner owner
+     *
+     * @return self
+     */
+    public function setOwner($owner)
+    {
+        if (is_null($owner)) {
+            array_push($this->openAPINullablesSetToNull, 'owner');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('owner', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['owner'] = $owner;
+
+        return $this;
+    }
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role 仅在部分查询口径下返回。
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            array_push($this->openAPINullablesSetToNull, 'role');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('role', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+
+    /**
+     * Gets created_at
+     *
+     * @return string|null
+     */
+    public function getCreatedAt()
+    {
+        return $this->container['created_at'];
+    }
+
+    /**
+     * Sets created_at
+     *
+     * @param string|null $created_at created_at
+     *
+     * @return self
+     */
+    public function setCreatedAt($created_at)
+    {
+        if (is_null($created_at)) {
+            throw new \InvalidArgumentException('non-nullable created_at cannot be null');
+        }
+        $this->container['created_at'] = $created_at;
+
+        return $this;
+    }
+
+    /**
+     * Gets updated_at
+     *
+     * @return string|null
+     */
+    public function getUpdatedAt()
+    {
+        return $this->container['updated_at'];
+    }
+
+    /**
+     * Sets updated_at
+     *
+     * @param string|null $updated_at updated_at
+     *
+     * @return self
+     */
+    public function setUpdatedAt($updated_at)
+    {
+        if (is_null($updated_at)) {
+            throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
+        }
+        $this->container['updated_at'] = $updated_at;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3GroupsGroupMembers200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3GroupsGroupMembers200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupsGroupMembers200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupsGroupMembers200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_groups_group_members_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3GroupsGroupMembers200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\PaginationMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3GroupsGroupMembers200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3GroupsGroupMembers200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\PaginationMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\PaginationMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 552 - 0
api-test/client/lib/Model/GetApiV3GroupsGroupMembers200ResponseDataInner.php

@@ -0,0 +1,552 @@
+<?php
+/**
+ * GetApiV3GroupsGroupMembers200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupsGroupMembers200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupsGroupMembers200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_groups_group_members_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'group_id' => 'string',
+        'role' => 'string',
+        'joined_at' => 'string',
+        'user' => '\WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'group_id' => null,
+        'role' => null,
+        'joined_at' => null,
+        'user' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'group_id' => false,
+        'role' => false,
+        'joined_at' => false,
+        'user' => true
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'group_id' => 'group_id',
+        'role' => 'role',
+        'joined_at' => 'joined_at',
+        'user' => 'user'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'group_id' => 'setGroupId',
+        'role' => 'setRole',
+        'joined_at' => 'setJoinedAt',
+        'user' => 'setUser'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'group_id' => 'getGroupId',
+        'role' => 'getRole',
+        'joined_at' => 'getJoinedAt',
+        'user' => 'getUser'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('group_id', $data ?? [], null);
+        $this->setIfExists('role', $data ?? [], null);
+        $this->setIfExists('joined_at', $data ?? [], null);
+        $this->setIfExists('user', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets group_id
+     *
+     * @return string|null
+     */
+    public function getGroupId()
+    {
+        return $this->container['group_id'];
+    }
+
+    /**
+     * Sets group_id
+     *
+     * @param string|null $group_id group_id
+     *
+     * @return self
+     */
+    public function setGroupId($group_id)
+    {
+        if (is_null($group_id)) {
+            throw new \InvalidArgumentException('non-nullable group_id cannot be null');
+        }
+        $this->container['group_id'] = $group_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role role
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            throw new \InvalidArgumentException('non-nullable role cannot be null');
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+
+    /**
+     * Gets joined_at
+     *
+     * @return string|null
+     */
+    public function getJoinedAt()
+    {
+        return $this->container['joined_at'];
+    }
+
+    /**
+     * Sets joined_at
+     *
+     * @param string|null $joined_at joined_at
+     *
+     * @return self
+     */
+    public function setJoinedAt($joined_at)
+    {
+        if (is_null($joined_at)) {
+            throw new \InvalidArgumentException('non-nullable joined_at cannot be null');
+        }
+        $this->container['joined_at'] = $joined_at;
+
+        return $this;
+    }
+
+    /**
+     * Gets user
+     *
+     * @return \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null
+     */
+    public function getUser()
+    {
+        return $this->container['user'];
+    }
+
+    /**
+     * Sets user
+     *
+     * @param \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null $user user
+     *
+     * @return self
+     */
+    public function setUser($user)
+    {
+        if (is_null($user)) {
+            array_push($this->openAPINullablesSetToNull, 'user');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('user', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['user'] = $user;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3GroupsGroupShares200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3GroupsGroupShares200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupsGroupShares200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupsGroupShares200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_groups_group_shares_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3GroupsGroupShares200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\PaginationMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3GroupsGroupShares200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3GroupsGroupShares200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\PaginationMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\PaginationMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 511 - 0
api-test/client/lib/Model/GetApiV3GroupsGroupShares200ResponseDataInner.php

@@ -0,0 +1,511 @@
+<?php
+/**
+ * GetApiV3GroupsGroupShares200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupsGroupShares200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupsGroupShares200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_groups_group_shares_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'role' => 'string',
+        'resource' => '\WikipaliApi\Model\GetApiV3GroupsGroupShares200ResponseDataInnerResource',
+        'created_at' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'role' => null,
+        'resource' => null,
+        'created_at' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'role' => false,
+        'resource' => false,
+        'created_at' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'role' => 'role',
+        'resource' => 'resource',
+        'created_at' => 'created_at'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'role' => 'setRole',
+        'resource' => 'setResource',
+        'created_at' => 'setCreatedAt'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'role' => 'getRole',
+        'resource' => 'getResource',
+        'created_at' => 'getCreatedAt'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('role', $data ?? [], null);
+        $this->setIfExists('resource', $data ?? [], null);
+        $this->setIfExists('created_at', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role role
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            throw new \InvalidArgumentException('non-nullable role cannot be null');
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+
+    /**
+     * Gets resource
+     *
+     * @return \WikipaliApi\Model\GetApiV3GroupsGroupShares200ResponseDataInnerResource|null
+     */
+    public function getResource()
+    {
+        return $this->container['resource'];
+    }
+
+    /**
+     * Sets resource
+     *
+     * @param \WikipaliApi\Model\GetApiV3GroupsGroupShares200ResponseDataInnerResource|null $resource resource
+     *
+     * @return self
+     */
+    public function setResource($resource)
+    {
+        if (is_null($resource)) {
+            throw new \InvalidArgumentException('non-nullable resource cannot be null');
+        }
+        $this->container['resource'] = $resource;
+
+        return $this;
+    }
+
+    /**
+     * Gets created_at
+     *
+     * @return string|null
+     */
+    public function getCreatedAt()
+    {
+        return $this->container['created_at'];
+    }
+
+    /**
+     * Sets created_at
+     *
+     * @param string|null $created_at created_at
+     *
+     * @return self
+     */
+    public function setCreatedAt($created_at)
+    {
+        if (is_null($created_at)) {
+            throw new \InvalidArgumentException('non-nullable created_at cannot be null');
+        }
+        $this->container['created_at'] = $created_at;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 566 - 0
api-test/client/lib/Model/GetApiV3GroupsGroupShares200ResponseDataInnerResource.php

@@ -0,0 +1,566 @@
+<?php
+/**
+ * GetApiV3GroupsGroupShares200ResponseDataInnerResource
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupsGroupShares200ResponseDataInnerResource Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupsGroupShares200ResponseDataInnerResource implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_groups_group_shares_200_response_data_inner_resource';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'type' => 'string',
+        'id' => 'string',
+        'title' => 'string',
+        'owner_id' => 'string',
+        'owner' => '\WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'type' => null,
+        'id' => null,
+        'title' => null,
+        'owner_id' => null,
+        'owner' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'type' => false,
+        'id' => false,
+        'title' => true,
+        'owner_id' => true,
+        'owner' => true
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'type' => 'type',
+        'id' => 'id',
+        'title' => 'title',
+        'owner_id' => 'owner_id',
+        'owner' => 'owner'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'type' => 'setType',
+        'id' => 'setId',
+        'title' => 'setTitle',
+        'owner_id' => 'setOwnerId',
+        'owner' => 'setOwner'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'type' => 'getType',
+        'id' => 'getId',
+        'title' => 'getTitle',
+        'owner_id' => 'getOwnerId',
+        'owner' => 'getOwner'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('type', $data ?? [], null);
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('title', $data ?? [], null);
+        $this->setIfExists('owner_id', $data ?? [], null);
+        $this->setIfExists('owner', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets type
+     *
+     * @return string|null
+     */
+    public function getType()
+    {
+        return $this->container['type'];
+    }
+
+    /**
+     * Sets type
+     *
+     * @param string|null $type type
+     *
+     * @return self
+     */
+    public function setType($type)
+    {
+        if (is_null($type)) {
+            throw new \InvalidArgumentException('non-nullable type cannot be null');
+        }
+        $this->container['type'] = $type;
+
+        return $this;
+    }
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets title
+     *
+     * @return string|null
+     */
+    public function getTitle()
+    {
+        return $this->container['title'];
+    }
+
+    /**
+     * Sets title
+     *
+     * @param string|null $title title
+     *
+     * @return self
+     */
+    public function setTitle($title)
+    {
+        if (is_null($title)) {
+            array_push($this->openAPINullablesSetToNull, 'title');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('title', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['title'] = $title;
+
+        return $this;
+    }
+
+    /**
+     * Gets owner_id
+     *
+     * @return string|null
+     */
+    public function getOwnerId()
+    {
+        return $this->container['owner_id'];
+    }
+
+    /**
+     * Sets owner_id
+     *
+     * @param string|null $owner_id owner_id
+     *
+     * @return self
+     */
+    public function setOwnerId($owner_id)
+    {
+        if (is_null($owner_id)) {
+            array_push($this->openAPINullablesSetToNull, 'owner_id');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('owner_id', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['owner_id'] = $owner_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets owner
+     *
+     * @return \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null
+     */
+    public function getOwner()
+    {
+        return $this->container['owner'];
+    }
+
+    /**
+     * Sets owner
+     *
+     * @param \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null $owner owner
+     *
+     * @return self
+     */
+    public function setOwner($owner)
+    {
+        if (is_null($owner)) {
+            array_push($this->openAPINullablesSetToNull, 'owner');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('owner', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['owner'] = $owner;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3MeGroups200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3MeGroups200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3MeGroups200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3MeGroups200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_me_groups_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3MeGroups200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\PaginationMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3MeGroups200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3MeGroups200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\PaginationMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\PaginationMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 729 - 0
api-test/client/lib/Model/GetApiV3MeGroups200ResponseDataInner.php

@@ -0,0 +1,729 @@
+<?php
+/**
+ * GetApiV3MeGroups200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3MeGroups200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3MeGroups200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_me_groups_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'name' => 'string',
+        'description' => 'string',
+        'owner_id' => 'string',
+        'owner' => '\WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser',
+        'status' => 'int',
+        'role' => 'string',
+        'member_id' => 'string',
+        'created_at' => 'string',
+        'joined_at' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'name' => null,
+        'description' => null,
+        'owner_id' => null,
+        'owner' => null,
+        'status' => null,
+        'role' => null,
+        'member_id' => null,
+        'created_at' => null,
+        'joined_at' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'name' => false,
+        'description' => true,
+        'owner_id' => false,
+        'owner' => true,
+        'status' => false,
+        'role' => false,
+        'member_id' => false,
+        'created_at' => false,
+        'joined_at' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'name' => 'name',
+        'description' => 'description',
+        'owner_id' => 'owner_id',
+        'owner' => 'owner',
+        'status' => 'status',
+        'role' => 'role',
+        'member_id' => 'member_id',
+        'created_at' => 'created_at',
+        'joined_at' => 'joined_at'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'name' => 'setName',
+        'description' => 'setDescription',
+        'owner_id' => 'setOwnerId',
+        'owner' => 'setOwner',
+        'status' => 'setStatus',
+        'role' => 'setRole',
+        'member_id' => 'setMemberId',
+        'created_at' => 'setCreatedAt',
+        'joined_at' => 'setJoinedAt'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'name' => 'getName',
+        'description' => 'getDescription',
+        'owner_id' => 'getOwnerId',
+        'owner' => 'getOwner',
+        'status' => 'getStatus',
+        'role' => 'getRole',
+        'member_id' => 'getMemberId',
+        'created_at' => 'getCreatedAt',
+        'joined_at' => 'getJoinedAt'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('name', $data ?? [], null);
+        $this->setIfExists('description', $data ?? [], null);
+        $this->setIfExists('owner_id', $data ?? [], null);
+        $this->setIfExists('owner', $data ?? [], null);
+        $this->setIfExists('status', $data ?? [], null);
+        $this->setIfExists('role', $data ?? [], null);
+        $this->setIfExists('member_id', $data ?? [], null);
+        $this->setIfExists('created_at', $data ?? [], null);
+        $this->setIfExists('joined_at', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets name
+     *
+     * @return string|null
+     */
+    public function getName()
+    {
+        return $this->container['name'];
+    }
+
+    /**
+     * Sets name
+     *
+     * @param string|null $name name
+     *
+     * @return self
+     */
+    public function setName($name)
+    {
+        if (is_null($name)) {
+            throw new \InvalidArgumentException('non-nullable name cannot be null');
+        }
+        $this->container['name'] = $name;
+
+        return $this;
+    }
+
+    /**
+     * Gets description
+     *
+     * @return string|null
+     */
+    public function getDescription()
+    {
+        return $this->container['description'];
+    }
+
+    /**
+     * Sets description
+     *
+     * @param string|null $description description
+     *
+     * @return self
+     */
+    public function setDescription($description)
+    {
+        if (is_null($description)) {
+            array_push($this->openAPINullablesSetToNull, 'description');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('description', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['description'] = $description;
+
+        return $this;
+    }
+
+    /**
+     * Gets owner_id
+     *
+     * @return string|null
+     */
+    public function getOwnerId()
+    {
+        return $this->container['owner_id'];
+    }
+
+    /**
+     * Sets owner_id
+     *
+     * @param string|null $owner_id owner_id
+     *
+     * @return self
+     */
+    public function setOwnerId($owner_id)
+    {
+        if (is_null($owner_id)) {
+            throw new \InvalidArgumentException('non-nullable owner_id cannot be null');
+        }
+        $this->container['owner_id'] = $owner_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets owner
+     *
+     * @return \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null
+     */
+    public function getOwner()
+    {
+        return $this->container['owner'];
+    }
+
+    /**
+     * Sets owner
+     *
+     * @param \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null $owner owner
+     *
+     * @return self
+     */
+    public function setOwner($owner)
+    {
+        if (is_null($owner)) {
+            array_push($this->openAPINullablesSetToNull, 'owner');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('owner', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['owner'] = $owner;
+
+        return $this;
+    }
+
+    /**
+     * Gets status
+     *
+     * @return int|null
+     */
+    public function getStatus()
+    {
+        return $this->container['status'];
+    }
+
+    /**
+     * Sets status
+     *
+     * @param int|null $status status
+     *
+     * @return self
+     */
+    public function setStatus($status)
+    {
+        if (is_null($status)) {
+            throw new \InvalidArgumentException('non-nullable status cannot be null');
+        }
+        $this->container['status'] = $status;
+
+        return $this;
+    }
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role role
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            throw new \InvalidArgumentException('non-nullable role cannot be null');
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+
+    /**
+     * Gets member_id
+     *
+     * @return string|null
+     */
+    public function getMemberId()
+    {
+        return $this->container['member_id'];
+    }
+
+    /**
+     * Sets member_id
+     *
+     * @param string|null $member_id member_id
+     *
+     * @return self
+     */
+    public function setMemberId($member_id)
+    {
+        if (is_null($member_id)) {
+            throw new \InvalidArgumentException('non-nullable member_id cannot be null');
+        }
+        $this->container['member_id'] = $member_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets created_at
+     *
+     * @return string|null
+     */
+    public function getCreatedAt()
+    {
+        return $this->container['created_at'];
+    }
+
+    /**
+     * Sets created_at
+     *
+     * @param string|null $created_at created_at
+     *
+     * @return self
+     */
+    public function setCreatedAt($created_at)
+    {
+        if (is_null($created_at)) {
+            throw new \InvalidArgumentException('non-nullable created_at cannot be null');
+        }
+        $this->container['created_at'] = $created_at;
+
+        return $this;
+    }
+
+    /**
+     * Gets joined_at
+     *
+     * @return string|null
+     */
+    public function getJoinedAt()
+    {
+        return $this->container['joined_at'];
+    }
+
+    /**
+     * Sets joined_at
+     *
+     * @param string|null $joined_at joined_at
+     *
+     * @return self
+     */
+    public function setJoinedAt($joined_at)
+    {
+        if (is_null($joined_at)) {
+            throw new \InvalidArgumentException('non-nullable joined_at cannot be null');
+        }
+        $this->container['joined_at'] = $joined_at;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 445 - 0
api-test/client/lib/Model/PatchApiV3GroupsGroupMembersMemberRequest.php

@@ -0,0 +1,445 @@
+<?php
+/**
+ * PatchApiV3GroupsGroupMembersMemberRequest
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PatchApiV3GroupsGroupMembersMemberRequest Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PatchApiV3GroupsGroupMembersMemberRequest implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'patch_api_v3_groups_group_members_member__request';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'role' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'role' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'role' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'role' => 'role'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'role' => 'setRole'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'role' => 'getRole'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+    public const ROLE_MANAGER = 'manager';
+    public const ROLE_EDITOR = 'editor';
+    public const ROLE_READER = 'reader';
+
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getRoleAllowableValues()
+    {
+        return [
+            self::ROLE_MANAGER,
+            self::ROLE_EDITOR,
+            self::ROLE_READER,
+        ];
+    }
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('role', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        $allowedValues = $this->getRoleAllowableValues();
+        if (!is_null($this->container['role']) && !in_array($this->container['role'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'role', must be one of '%s'",
+                $this->container['role'],
+                implode("', '", $allowedValues)
+            );
+        }
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role 角色
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            throw new \InvalidArgumentException('non-nullable role cannot be null');
+        }
+        $allowedValues = $this->getRoleAllowableValues();
+        if (!in_array($role, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'role', must be one of '%s'",
+                    $role,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 477 - 0
api-test/client/lib/Model/PatchApiV3GroupsGroupRequest.php

@@ -0,0 +1,477 @@
+<?php
+/**
+ * PatchApiV3GroupsGroupRequest
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PatchApiV3GroupsGroupRequest Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PatchApiV3GroupsGroupRequest implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'patch_api_v3_groups_group__request';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'name' => 'string',
+        'description' => 'string',
+        'status' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'name' => null,
+        'description' => null,
+        'status' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'name' => false,
+        'description' => false,
+        'status' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'name' => 'name',
+        'description' => 'description',
+        'status' => 'status'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'name' => 'setName',
+        'description' => 'setDescription',
+        'status' => 'setStatus'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'name' => 'getName',
+        'description' => 'getDescription',
+        'status' => 'getStatus'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('name', $data ?? [], null);
+        $this->setIfExists('description', $data ?? [], null);
+        $this->setIfExists('status', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets name
+     *
+     * @return string|null
+     */
+    public function getName()
+    {
+        return $this->container['name'];
+    }
+
+    /**
+     * Sets name
+     *
+     * @param string|null $name 团队名,最长 64
+     *
+     * @return self
+     */
+    public function setName($name)
+    {
+        if (is_null($name)) {
+            throw new \InvalidArgumentException('non-nullable name cannot be null');
+        }
+        $this->container['name'] = $name;
+
+        return $this;
+    }
+
+    /**
+     * Gets description
+     *
+     * @return string|null
+     */
+    public function getDescription()
+    {
+        return $this->container['description'];
+    }
+
+    /**
+     * Sets description
+     *
+     * @param string|null $description 简介,最长 1024
+     *
+     * @return self
+     */
+    public function setDescription($description)
+    {
+        if (is_null($description)) {
+            throw new \InvalidArgumentException('non-nullable description cannot be null');
+        }
+        $this->container['description'] = $description;
+
+        return $this;
+    }
+
+    /**
+     * Gets status
+     *
+     * @return int|null
+     */
+    public function getStatus()
+    {
+        return $this->container['status'];
+    }
+
+    /**
+     * Sets status
+     *
+     * @param int|null $status 10 私有、30 公开
+     *
+     * @return self
+     */
+    public function setStatus($status)
+    {
+        if (is_null($status)) {
+            throw new \InvalidArgumentException('non-nullable status cannot be null');
+        }
+        $this->container['status'] = $status;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 2 - 2
api-test/client/lib/Model/PostApiV3AgentChargesRequest.php

@@ -15,7 +15,7 @@
  *
  *
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  *
  *
- * The version of the OpenAPI document: 2026.11.12
+ * The version of the OpenAPI document: 1.0.0
  * Generated by: https://openapi-generator.tech
  * Generated by: https://openapi-generator.tech
  * Generator version: 7.25.0
  * Generator version: 7.25.0
  */
  */
@@ -441,7 +441,7 @@ class PostApiV3AgentChargesRequest implements ModelInterface, ArrayAccess, \Json
     /**
     /**
      * Sets client_ip
      * Sets client_ip
      *
      *
-     * @param string|null $client_ip 客户端 IP。只对游客用于同 IP 上限
+     * @param string|null $client_ip 客户端 IP(runtime 写入)。游客必填,没有就 422;只对游客用于同 IP 上限
      *
      *
      * @return self
      * @return self
      */
      */

+ 35 - 1
api-test/client/lib/Model/PostApiV3AgentTraces200ResponseData.php

@@ -15,7 +15,7 @@
  *
  *
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  *
  *
- * The version of the OpenAPI document: 2026.11.12
+ * The version of the OpenAPI document: 1.0.0
  * Generated by: https://openapi-generator.tech
  * Generated by: https://openapi-generator.tech
  * Generator version: 7.25.0
  * Generator version: 7.25.0
  */
  */
@@ -246,6 +246,21 @@ class PostApiV3AgentTraces200ResponseData implements ModelInterface, ArrayAccess
         return self::$openAPIModelName;
         return self::$openAPIModelName;
     }
     }
 
 
+    public const ACCOUNT_TYPE_USER = 'user';
+    public const ACCOUNT_TYPE_GUEST = 'guest';
+
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getAccountTypeAllowableValues()
+    {
+        return [
+            self::ACCOUNT_TYPE_USER,
+            self::ACCOUNT_TYPE_GUEST,
+        ];
+    }
 
 
     /**
     /**
      * Associative array for storing property values
      * Associative array for storing property values
@@ -295,6 +310,15 @@ class PostApiV3AgentTraces200ResponseData implements ModelInterface, ArrayAccess
     {
     {
         $invalidProperties = [];
         $invalidProperties = [];
 
 
+        $allowedValues = $this->getAccountTypeAllowableValues();
+        if (!is_null($this->container['account_type']) && !in_array($this->container['account_type'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'account_type', must be one of '%s'",
+                $this->container['account_type'],
+                implode("', '", $allowedValues)
+            );
+        }
+
         return $invalidProperties;
         return $invalidProperties;
     }
     }
 
 
@@ -386,6 +410,16 @@ class PostApiV3AgentTraces200ResponseData implements ModelInterface, ArrayAccess
         if (is_null($account_type)) {
         if (is_null($account_type)) {
             throw new \InvalidArgumentException('non-nullable account_type cannot be null');
             throw new \InvalidArgumentException('non-nullable account_type cannot be null');
         }
         }
+        $allowedValues = $this->getAccountTypeAllowableValues();
+        if (!in_array($account_type, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'account_type', must be one of '%s'",
+                    $account_type,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
         $this->container['account_type'] = $account_type;
         $this->container['account_type'] = $account_type;
 
 
         return $this;
         return $this;

+ 409 - 0
api-test/client/lib/Model/PostApiV3Groups200Response.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * PostApiV3Groups200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3Groups200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3Groups200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_groups_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3Groups200ResponseDataInner'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3Groups200ResponseDataInner|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3Groups200ResponseDataInner|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 409 - 0
api-test/client/lib/Model/PostApiV3GroupsGroupMembers200Response.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * PostApiV3GroupsGroupMembers200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3GroupsGroupMembers200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3GroupsGroupMembers200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_groups_group_members_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3GroupsGroupMembers200ResponseDataInner'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3GroupsGroupMembers200ResponseDataInner|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3GroupsGroupMembers200ResponseDataInner|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 482 - 0
api-test/client/lib/Model/PostApiV3GroupsGroupMembersRequest.php

@@ -0,0 +1,482 @@
+<?php
+/**
+ * PostApiV3GroupsGroupMembersRequest
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3GroupsGroupMembersRequest Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3GroupsGroupMembersRequest implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_groups_group_members_request';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'user_id' => 'string',
+        'role' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'user_id' => null,
+        'role' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'user_id' => false,
+        'role' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'user_id' => 'user_id',
+        'role' => 'role'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'user_id' => 'setUserId',
+        'role' => 'setRole'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'user_id' => 'getUserId',
+        'role' => 'getRole'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+    public const ROLE_MANAGER = 'manager';
+    public const ROLE_EDITOR = 'editor';
+    public const ROLE_READER = 'reader';
+
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getRoleAllowableValues()
+    {
+        return [
+            self::ROLE_MANAGER,
+            self::ROLE_EDITOR,
+            self::ROLE_READER,
+        ];
+    }
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('user_id', $data ?? [], null);
+        $this->setIfExists('role', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        if ($this->container['user_id'] === null) {
+            $invalidProperties[] = "'user_id' can't be null";
+        }
+        $allowedValues = $this->getRoleAllowableValues();
+        if (!is_null($this->container['role']) && !in_array($this->container['role'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'role', must be one of '%s'",
+                $this->container['role'],
+                implode("', '", $allowedValues)
+            );
+        }
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets user_id
+     *
+     * @return string
+     */
+    public function getUserId()
+    {
+        return $this->container['user_id'];
+    }
+
+    /**
+     * Sets user_id
+     *
+     * @param string $user_id 要加入的用户 uuid
+     *
+     * @return self
+     */
+    public function setUserId($user_id)
+    {
+        if (is_null($user_id)) {
+            throw new \InvalidArgumentException('non-nullable user_id cannot be null');
+        }
+        $this->container['user_id'] = $user_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role 角色,默认 reader
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            throw new \InvalidArgumentException('non-nullable role cannot be null');
+        }
+        $allowedValues = $this->getRoleAllowableValues();
+        if (!in_array($role, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'role', must be one of '%s'",
+                    $role,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 480 - 0
api-test/client/lib/Model/PostApiV3GroupsRequest.php

@@ -0,0 +1,480 @@
+<?php
+/**
+ * PostApiV3GroupsRequest
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3GroupsRequest Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3GroupsRequest implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_groups_request';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'name' => 'string',
+        'description' => 'string',
+        'status' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'name' => null,
+        'description' => null,
+        'status' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'name' => false,
+        'description' => false,
+        'status' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'name' => 'name',
+        'description' => 'description',
+        'status' => 'status'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'name' => 'setName',
+        'description' => 'setDescription',
+        'status' => 'setStatus'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'name' => 'getName',
+        'description' => 'getDescription',
+        'status' => 'getStatus'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('name', $data ?? [], null);
+        $this->setIfExists('description', $data ?? [], null);
+        $this->setIfExists('status', $data ?? [], 30);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        if ($this->container['name'] === null) {
+            $invalidProperties[] = "'name' can't be null";
+        }
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets name
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->container['name'];
+    }
+
+    /**
+     * Sets name
+     *
+     * @param string $name 团队名,最长 64
+     *
+     * @return self
+     */
+    public function setName($name)
+    {
+        if (is_null($name)) {
+            throw new \InvalidArgumentException('non-nullable name cannot be null');
+        }
+        $this->container['name'] = $name;
+
+        return $this;
+    }
+
+    /**
+     * Gets description
+     *
+     * @return string|null
+     */
+    public function getDescription()
+    {
+        return $this->container['description'];
+    }
+
+    /**
+     * Sets description
+     *
+     * @param string|null $description 简介,最长 1024
+     *
+     * @return self
+     */
+    public function setDescription($description)
+    {
+        if (is_null($description)) {
+            throw new \InvalidArgumentException('non-nullable description cannot be null');
+        }
+        $this->container['description'] = $description;
+
+        return $this;
+    }
+
+    /**
+     * Gets status
+     *
+     * @return int|null
+     */
+    public function getStatus()
+    {
+        return $this->container['status'];
+    }
+
+    /**
+     * Sets status
+     *
+     * @param int|null $status 10 私有、30 公开
+     *
+     * @return self
+     */
+    public function setStatus($status)
+    {
+        if (is_null($status)) {
+            throw new \InvalidArgumentException('non-nullable status cannot be null');
+        }
+        $this->container['status'] = $status;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 5 - 0
api-test/fixtures.php

@@ -34,6 +34,11 @@ return [
     // agent 代写用例:归测试账号所有的 AI 模型 uid,按环境在 config.local.php 里配,没配则 SKIP
     // agent 代写用例:归测试账号所有的 AI 模型 uid,按环境在 config.local.php 里配,没配则 SKIP
     'agent_model' => null,
     'agent_model' => null,
 
 
+    // groups 用例:测试账号名下的团队名(不存在就经 v2 建一个,跑完保留)与要拉进团队的另一个账号。
+    // 第二个账号用户名按环境覆盖;留空则加人 / 改角色 / 移人那一轮 SKIP。
+    'group_name' => 'api-test 团队',
+    'group_member_username' => 'test162',
+
     // 一个已注册账号的邮箱(email-certifications 的「已注册」用例;只校验、不发信)。
     // 一个已注册账号的邮箱(email-certifications 的「已注册」用例;只校验、不发信)。
     // 留空则该用例 SKIP。
     // 留空则该用例 SKIP。
     'registered_email' => getenv('API_TEST_REGISTERED_EMAIL') ?: null,
     'registered_email' => getenv('API_TEST_REGISTERED_EMAIL') ?: null,

+ 121 - 0
api-v13/app/Http/Controllers/V3/GroupController.php

@@ -0,0 +1,121 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Concerns\ResolvesCurrentUser;
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexGroupRequest;
+use App\Http\Requests\V3\StoreGroupRequest;
+use App\Http\Requests\V3\UpdateGroupRequest;
+use App\Http\Resources\V3\GroupResource;
+use App\Models\GroupInfo;
+use App\Services\V3\GroupService;
+use Illuminate\Http\Request;
+
+/**
+ * 团队本身:搜公开团队、详情、建、改、删。
+ *
+ * 取代 `GET /v2/group?view=all`、`GET|POST|PUT|DELETE /v2/group(/{id})`(`GroupController`)。
+ * 「我的团队」列表见 {@see MeGroupController}。v2 那份在 dashboard-v4 下线前原样保留,不要改动。
+ *
+ * 不支持 AI 模型代写(2026-11-13 定)。
+ */
+class GroupController extends Controller
+{
+    use ResolvesCurrentUser;
+
+    public function __construct(private readonly GroupService $groups) {}
+
+    /**
+     * 搜公开团队
+     *
+     * 共享资源时挑团队用。只列公开团队(status 30),按名字排序。
+     *
+     * @queryParam search string 按团队名模糊匹配
+     * @queryParam page integer 页码。Default: 1
+     * @queryParam per_page integer 每页数量,最大 200。Default: 20
+     */
+    public function index(IndexGroupRequest $request)
+    {
+        return GroupResource::collection($this->groups->searchPublic(
+            $request->validated('search'),
+            $request->integer('per_page', 20),
+        ));
+    }
+
+    /**
+     * 建团队
+     *
+     * 建的人成为 owner。同一个人名下不能重名。
+     *
+     * @bodyParam name string required 团队名,最长 64
+     * @bodyParam description string 简介,最长 1024
+     * @bodyParam status integer 10 私有、30 公开。Default: 30
+     *
+     * @responseStatus 201 建好了
+     */
+    public function store(StoreGroupRequest $request)
+    {
+        return GroupResource::make($this->groups->create(
+            $this->currentUser($request)['user_uid'],
+            $request->validated(),
+        ));
+    }
+
+    /**
+     * 团队详情
+     *
+     * 公开团队谁都能看(可不登录),私有团队只有成员能看。带查看者在团队里的角色。
+     *
+     * @unauthenticated
+     *
+     * @urlParam group string required 团队 uid
+     *
+     * @responseStatus 403 私有团队,且不是成员
+     */
+    public function show(Request $request, GroupInfo $group)
+    {
+        return GroupResource::make($this->groups->show($group, $this->currentUserUid($request)));
+    }
+
+    /**
+     * 改团队信息
+     *
+     * 团队的 owner / manager 才能调用,只改传了的字段。
+     *
+     * @urlParam group string required 团队 uid
+     *
+     * @bodyParam name string 团队名,最长 64
+     * @bodyParam description string 简介,最长 1024
+     * @bodyParam status integer 10 私有、30 公开
+     *
+     * @responseStatus 403 不能修改这个团队
+     */
+    public function update(UpdateGroupRequest $request, GroupInfo $group)
+    {
+        return GroupResource::make($this->groups->update(
+            $group,
+            $this->currentUser($request)['user_uid'],
+            $request->validated(),
+        ));
+    }
+
+    /**
+     * 删团队
+     *
+     * 只有 owner 能删。团队名下还有资源(channel、文章等)时拒绝,`resources` 里给出各类的条数;
+     * 否则连同成员与共享给团队的记录一起硬删,返回 204 空体。
+     *
+     * @urlParam group string required 团队 uid
+     *
+     * @responseStatus 204 已删除,无响应体
+     * @responseStatus 403 只有 owner 能删
+     * @responseStatus 409 团队名下还有资源
+     */
+    public function destroy(Request $request, GroupInfo $group)
+    {
+        $this->groups->delete($group, $this->currentUser($request)['user_uid']);
+
+        return response()->noContent();
+    }
+}

+ 114 - 0
api-v13/app/Http/Controllers/V3/GroupMemberController.php

@@ -0,0 +1,114 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Concerns\ResolvesCurrentUser;
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexGroupMemberRequest;
+use App\Http\Requests\V3\StoreGroupMemberRequest;
+use App\Http\Requests\V3\UpdateGroupMemberRequest;
+use App\Http\Resources\V3\GroupMemberResource;
+use App\Models\GroupInfo;
+use App\Models\GroupMember;
+use App\Services\V3\GroupMemberService;
+use Illuminate\Http\Request;
+
+/**
+ * 团队成员:列表、加人、改角色、移人 / 退出。
+ *
+ * 取代 `GET /v2/group-member?view=group`、`POST /v2/group-member`、
+ * `DELETE /v2/group-member/{id}`(`GroupMemberController`);v2 的 PUT 是空实现,
+ * 改角色是 v3 新增。v2 那份在 dashboard-v4 下线前原样保留,不要改动。
+ *
+ * 不支持 AI 模型代写(2026-11-13 定):成员管理就是权限本身,只给人类账号。
+ */
+class GroupMemberController extends Controller
+{
+    use ResolvesCurrentUser;
+
+    public function __construct(private readonly GroupMemberService $members) {}
+
+    /**
+     * 列出团队成员
+     *
+     * 只有团队成员看得到。owner、manager 在前,其余按加入时间排序。
+     *
+     * @urlParam group string required 团队 uid
+     *
+     * @queryParam page integer 页码。Default: 1
+     * @queryParam per_page integer 每页数量,最大 200。Default: 100
+     *
+     * @responseStatus 403 不是这个团队的成员
+     */
+    public function index(IndexGroupMemberRequest $request, GroupInfo $group)
+    {
+        return GroupMemberResource::collection($this->members->listForGroup(
+            $group,
+            $this->currentUser($request)['user_uid'],
+            $request->integer('per_page', 100),
+        ));
+    }
+
+    /**
+     * 加一名成员
+     *
+     * 团队的 owner / manager 才能调用。角色默认 reader(只读)。
+     *
+     * @urlParam group string required 团队 uid
+     *
+     * @bodyParam user_id string required 要加入的用户 uuid
+     * @bodyParam role string 角色,默认 reader。Enum: manager,editor,reader
+     *
+     * @responseStatus 201 加入成功
+     * @responseStatus 403 不能管理这个团队的成员
+     */
+    public function store(StoreGroupMemberRequest $request, GroupInfo $group)
+    {
+        return GroupMemberResource::make($this->members->add(
+            $group,
+            $this->currentUser($request)['user_uid'],
+            $request->validated(),
+        ));
+    }
+
+    /**
+     * 改成员角色
+     *
+     * 团队的 owner / manager 才能调用;owner 那一行不能改。
+     *
+     * @urlParam group string required 团队 uid
+     * @urlParam member string required 成员记录 id
+     *
+     * @bodyParam role string 角色。Enum: manager,editor,reader
+     *
+     * @responseStatus 403 不能管理这个团队的成员,或目标是团队拥有者
+     */
+    public function update(UpdateGroupMemberRequest $request, GroupInfo $group, GroupMember $member)
+    {
+        return GroupMemberResource::make($this->members->update(
+            $group,
+            $member,
+            $this->currentUser($request)['user_uid'],
+            $request->validated(),
+        ));
+    }
+
+    /**
+     * 移除成员 / 退出团队
+     *
+     * 移除别人要 owner / manager;移除自己就是退出团队。owner 不能被移除、也不能退出。
+     * 硬删,成功返回 204 空体。
+     *
+     * @urlParam group string required 团队 uid
+     * @urlParam member string required 成员记录 id
+     *
+     * @responseStatus 204 已移除,无响应体
+     * @responseStatus 403 不能移除这名成员
+     */
+    public function destroy(Request $request, GroupInfo $group, GroupMember $member)
+    {
+        $this->members->remove($group, $member, $this->currentUser($request)['user_uid']);
+
+        return response()->noContent();
+    }
+}

+ 65 - 0
api-v13/app/Http/Controllers/V3/GroupShareController.php

@@ -0,0 +1,65 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Concerns\ResolvesCurrentUser;
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexGroupShareRequest;
+use App\Http\Resources\V3\GroupShareResource;
+use App\Models\GroupInfo;
+use App\Models\Share;
+use App\Services\V3\GroupShareService;
+use Illuminate\Http\Request;
+
+/**
+ * 团队文档:共享给团队的资源。
+ *
+ * 取代 `GET /v2/share?view=group`(`ShareController@index`)与团队页上经
+ * `DELETE /v2/share/{id}` 把资源移出团队。资源本身的协作者管理仍走 v2 share。
+ * v2 那份在 dashboard-v4 下线前原样保留,不要改动。
+ */
+class GroupShareController extends Controller
+{
+    use ResolvesCurrentUser;
+
+    public function __construct(private readonly GroupShareService $shares) {}
+
+    /**
+     * 列出团队文档
+     *
+     * 只有团队成员看得到。每条带资源类型、标题与拥有者,以及团队对它的权限(reader / editor)。
+     *
+     * @urlParam group string required 团队 uid
+     *
+     * @queryParam page integer 页码。Default: 1
+     * @queryParam per_page integer 每页数量,最大 200。Default: 20
+     *
+     * @responseStatus 403 不是这个团队的成员
+     */
+    public function index(IndexGroupShareRequest $request, GroupInfo $group)
+    {
+        return GroupShareResource::collection($this->shares->list(
+            $group,
+            $this->currentUser($request)['user_uid'],
+            $request->integer('per_page', 20),
+        ));
+    }
+
+    /**
+     * 把资源移出团队
+     *
+     * 团队的 owner / manager,或资源的拥有者才能调用。只删这条共享,资源本身不动。
+     *
+     * @urlParam group string required 团队 uid
+     * @urlParam share string required 共享记录 id
+     *
+     * @responseStatus 204 已移出,无响应体
+     * @responseStatus 403 不能移出这项资源
+     */
+    public function destroy(Request $request, GroupInfo $group, Share $share)
+    {
+        $this->shares->remove($group, $share, $this->currentUser($request)['user_uid']);
+
+        return response()->noContent();
+    }
+}

+ 48 - 0
api-v13/app/Http/Controllers/V3/MeGroupController.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Concerns\ResolvesCurrentUser;
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexMeGroupRequest;
+use App\Http\Resources\V3\MeGroupResource;
+use App\Services\V3\GroupMemberService;
+
+/**
+ * 我加入的团队(团队空间的候选身份)。
+ *
+ * 取代 `GET /v2/group-member?view=user`(`GroupMemberController@index`)、
+ * `GET /v2/group?view=studio&view2=…` 与 `GET /v2/group-my-number`(`GroupController`):
+ * 「我创建的 / 我参加的」用 `owned` 过滤,数量读 `meta.total`。v2 那几份在
+ * dashboard-v4 下线前原样保留,不要改动。
+ */
+class MeGroupController extends Controller
+{
+    use ResolvesCurrentUser;
+
+    public function __construct(private readonly GroupMemberService $members) {}
+
+    /**
+     * 列出我加入的团队
+     *
+     * 每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
+     *
+     * @queryParam owned boolean true 只列我创建的,false 只列我参加的别人的团队;不传列全部
+     * @queryParam search string 按团队名模糊匹配
+     * @queryParam page integer 页码。Default: 1
+     * @queryParam per_page integer 每页数量,最大 200。Default: 100
+     */
+    public function __invoke(IndexMeGroupRequest $request)
+    {
+        $filters = $request->safe()->only(['search']);
+        if ($request->has('owned')) {
+            $filters['owned'] = $request->boolean('owned');
+        }
+
+        return MeGroupResource::collection($this->members->listForUser(
+            $this->currentUser($request)['user_uid'],
+            $filters,
+            $request->integer('per_page', 100),
+        ));
+    }
+}

+ 5 - 1
api-v13/app/Http/Middleware/V3/Authenticate.php

@@ -5,6 +5,7 @@ namespace App\Http\Middleware\V3;
 use App\Services\AuthService;
 use App\Services\AuthService;
 use Closure;
 use Closure;
 use Illuminate\Auth\AuthenticationException;
 use Illuminate\Auth\AuthenticationException;
+use Illuminate\Contracts\Auth\Middleware\AuthenticatesRequests;
 use Illuminate\Http\Request;
 use Illuminate\Http\Request;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpFoundation\Response;
 
 
@@ -26,8 +27,11 @@ use Symfony\Component\HttpFoundation\Response;
  *    `$_COOKIE['user_uid']`,那是 v2 的旁路;v3 硬规范要求统一 bearer,所以这里
  *    `$_COOKIE['user_uid']`,那是 v2 的旁路;v3 硬规范要求统一 bearer,所以这里
  *    先自己挡一道。不改 `AuthService`——它是 v2 也在用的共享代码。
  *    先自己挡一道。不改 `AuthService`——它是 v2 也在用的共享代码。
  * 2. **解出来的用户存进 request attributes**,控制器直接取,不必再解一次 JWT。
  * 2. **解出来的用户存进 request attributes**,控制器直接取,不必再解一次 JWT。
+ * 3. **实现 `AuthenticatesRequests` 标记接口**,让框架的中间件优先级把它排在
+ *    `SubstituteBindings`(路由模型绑定)之前:否则未登录访问不存在的资源先得到 404
+ *    而不是 401,还顺带泄露了资源是否存在。
  */
  */
-class Authenticate
+class Authenticate implements AuthenticatesRequests
 {
 {
     /**
     /**
      * 解析出的用户存在 request attributes 的哪个键下。
      * 解析出的用户存在 request attributes 的哪个键下。

+ 31 - 0
api-v13/app/Http/Requests/V3/IndexGroupMemberRequest.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/groups/{group}/members` 的入参:团队成员列表。
+ */
+class IndexGroupMemberRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'page' => ['integer', 'min:1'],
+            'per_page' => ['integer', 'min:1', 'max:200'],
+        ];
+    }
+}

+ 32 - 0
api-v13/app/Http/Requests/V3/IndexGroupRequest.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/groups` 的入参:按名字搜公开团队。
+ */
+class IndexGroupRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'search' => ['sometimes', 'nullable', 'string', 'max:64'],
+            'page' => ['integer', 'min:1'],
+            'per_page' => ['integer', 'min:1', 'max:200'],
+        ];
+    }
+}

+ 31 - 0
api-v13/app/Http/Requests/V3/IndexGroupShareRequest.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/groups/{group}/shares` 的入参:团队文档列表。
+ */
+class IndexGroupShareRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'page' => ['integer', 'min:1'],
+            'per_page' => ['integer', 'min:1', 'max:200'],
+        ];
+    }
+}

+ 33 - 0
api-v13/app/Http/Requests/V3/IndexMeGroupRequest.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/me/groups` 的入参:我加入的团队。结果集由登录态决定,不接受指定用户。
+ */
+class IndexMeGroupRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'owned' => ['sometimes', 'in:true,false,1,0'],
+            'search' => ['sometimes', 'nullable', 'string', 'max:64'],
+            'page' => ['integer', 'min:1'],
+            'per_page' => ['integer', 'min:1', 'max:200'],
+        ];
+    }
+}

+ 33 - 0
api-v13/app/Http/Requests/V3/StoreGroupMemberRequest.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use App\Models\GroupMember;
+use Illuminate\Foundation\Http\FormRequest;
+use Illuminate\Validation\Rule;
+
+/**
+ * `POST /v3/groups/{group}/members` 的入参:加一名成员,角色默认 reader。owner 不能经此产生。
+ */
+class StoreGroupMemberRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'user_id' => ['required', 'uuid'],
+            'role' => ['sometimes', 'string', Rule::in(GroupMember::ASSIGNABLE_ROLES)],
+        ];
+    }
+}

+ 33 - 0
api-v13/app/Http/Requests/V3/StoreGroupRequest.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use App\Models\GroupInfo;
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `POST /v3/groups` 的入参:建团队。同一个人名下不能重名(Service 里判)。
+ */
+class StoreGroupRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'name' => ['required', 'string', 'max:64'],
+            'description' => ['sometimes', 'nullable', 'string', 'max:1024'],
+            'status' => ['sometimes', 'integer', 'in:'.GroupInfo::STATUS_PRIVATE.','.GroupInfo::STATUS_PUBLIC],
+        ];
+    }
+}

+ 32 - 0
api-v13/app/Http/Requests/V3/UpdateGroupMemberRequest.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use App\Models\GroupMember;
+use Illuminate\Foundation\Http\FormRequest;
+use Illuminate\Validation\Rule;
+
+/**
+ * `PATCH /v3/groups/{group}/members/{member}` 的入参:改成员角色。只做局部更新,没有必填项。
+ */
+class UpdateGroupMemberRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'role' => ['sometimes', 'string', Rule::in(GroupMember::ASSIGNABLE_ROLES)],
+        ];
+    }
+}

+ 33 - 0
api-v13/app/Http/Requests/V3/UpdateGroupRequest.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use App\Models\GroupInfo;
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `PATCH /v3/groups/{group}` 的入参:改团队信息。只做局部更新,没有必填项。
+ */
+class UpdateGroupRequest extends FormRequest
+{
+    /**
+     * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
+     * 而「没登录」应该是 401、「不是成员」要带具体文案。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'name' => ['sometimes', 'string', 'max:64'],
+            'description' => ['sometimes', 'nullable', 'string', 'max:1024'],
+            'status' => ['sometimes', 'integer', 'in:'.GroupInfo::STATUS_PRIVATE.','.GroupInfo::STATUS_PUBLIC],
+        ];
+    }
+}

+ 41 - 0
api-v13/app/Http/Resources/V3/GroupMemberResource.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use App\Http\Resources\Concerns\ResolvesActor;
+use App\Models\GroupMember;
+use Illuminate\Http\Request;
+
+/**
+ * 团队里的一名成员。
+ *
+ * `role` 是实际角色({@see GroupMember::effectiveRole()}),v2 写入、role 列为空的行
+ * 也会按 power 推出来。**本类不查库**:user 来自控制器预加载的关系。
+ *
+ * @mixin GroupMember
+ */
+class GroupMemberResource extends BaseResource
+{
+    use ResolvesActor;
+
+    /**
+     * @param  Request  $request
+     * @return array{
+     *     id: string,
+     *     group_id: string,
+     *     role: string,
+     *     joined_at: string,
+     *     user: array{id: string, nickName: string, userName: string, realName: string, sn: int, avatar: string|null, roles: array|null}|null
+     * }
+     */
+    public function toArray($request): array
+    {
+        return [
+            'id' => (string) $this->id,
+            'group_id' => $this->group_id,
+            'role' => $this->effectiveRole(),
+            'joined_at' => $this->created_at,
+            'user' => $this->actor($this->user),
+        ];
+    }
+}

+ 48 - 0
api-v13/app/Http/Resources/V3/GroupResource.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use App\Http\Resources\Concerns\ResolvesActor;
+use App\Models\GroupInfo;
+use Illuminate\Http\Request;
+
+/**
+ * 一个团队。
+ *
+ * `role` 是**查看者**在团队里的角色(不是成员就是 null),只在详情、新建、修改时给,
+ * 搜索列表里没有。`owner` 是创建者的公开摘要。**本类不查库**:creator 来自预加载,
+ * role 由 Service 挂在 `viewer_role` 上。
+ *
+ * @mixin GroupInfo
+ */
+class GroupResource extends BaseResource
+{
+    use ResolvesActor;
+
+    /**
+     * @param  Request  $request
+     * @return array{
+     *     id: string,
+     *     name: string,
+     *     description: string|null,
+     *     status: int,
+     *     owner: array{id: string, nickName: string, userName: string, realName: string, sn: int, avatar: string|null, roles: array|null}|null,
+     *     role?: string|null,
+     *     created_at: string,
+     *     updated_at: string
+     * }
+     */
+    public function toArray($request): array
+    {
+        return [
+            'id' => $this->uid,
+            'name' => $this->name,
+            'description' => $this->description,
+            'status' => (int) $this->status,
+            'owner' => $this->actor($this->creator),
+            'role' => $this->when(array_key_exists('viewer_role', $this->resource->getAttributes()), fn () => $this->viewer_role),
+            'created_at' => $this->created_at,
+            'updated_at' => $this->updated_at,
+        ];
+    }
+}

+ 36 - 0
api-v13/app/Http/Resources/V3/GroupShareResource.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use App\Models\Share;
+use Illuminate\Http\Request;
+
+/**
+ * 团队文档里的一项:共享给团队的一个资源。
+ *
+ * `role` 由 v2 的 power 换来:10 → reader(只读),20 → editor(可编辑)。
+ * `resource` 由 Service 按类型批量取好挂上来,**本类不查库**;资源已被删掉时 title / owner_id 为 null。
+ *
+ * @mixin Share
+ */
+class GroupShareResource extends BaseResource
+{
+    /**
+     * @param  Request  $request
+     * @return array{
+     *     id: string,
+     *     role: string,
+     *     resource: array{type: string, id: string, title: string|null, owner_id: string|null, owner: array{id: string, nickName: string, userName: string, realName: string, sn: int, avatar: string|null, roles: array|null}|null},
+     *     created_at: string
+     * }
+     */
+    public function toArray($request): array
+    {
+        return [
+            'id' => (string) $this->id,
+            'role' => (int) $this->power >= 20 ? 'editor' : 'reader',
+            'resource' => $this->getAttribute('resource'),
+            'created_at' => $this->created_at,
+        ];
+    }
+}

+ 51 - 0
api-v13/app/Http/Resources/V3/MeGroupResource.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use App\Http\Resources\Concerns\ResolvesActor;
+use App\Models\GroupMember;
+use Illuminate\Http\Request;
+
+/**
+ * 我加入的一个团队,带我在里面的角色。载荷是成员记录,团队信息来自预加载的 group。
+ *
+ * `id` 是团队的 uid:调用方拿它当团队空间的身份、调 `/v3/groups/{group}/members`。
+ * 我自己那条成员记录的 id 在 `member_id`,退出团队时用。
+ *
+ * @mixin GroupMember
+ */
+class MeGroupResource extends BaseResource
+{
+    use ResolvesActor;
+
+    /**
+     * @param  Request  $request
+     * @return array{
+     *     id: string,
+     *     name: string,
+     *     description: string|null,
+     *     owner_id: string,
+     *     owner: array{id: string, nickName: string, userName: string, realName: string, sn: int, avatar: string|null, roles: array|null}|null,
+     *     status: int,
+     *     role: string,
+     *     member_id: string,
+     *     created_at: string,
+     *     joined_at: string
+     * }
+     */
+    public function toArray($request): array
+    {
+        return [
+            'id' => $this->group_id,
+            'name' => $this->group->name,
+            'description' => $this->group->description,
+            'owner_id' => $this->group->owner,
+            'owner' => $this->actor($this->group->creator),
+            'status' => (int) $this->group->status,
+            'role' => $this->effectiveRole(),
+            'member_id' => (string) $this->id,
+            'created_at' => $this->group->created_at,
+            'joined_at' => $this->created_at,
+        ];
+    }
+}

+ 38 - 0
api-v13/app/Models/GroupInfo.php

@@ -4,14 +4,52 @@ namespace App\Models;
 
 
 use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
 
 
+/**
+ * 团队(group)。表 `group_infos`,界面上叫「团队」,团队空间以它为 owner。
+ *
+ * `status`:30 公开(能被搜到、非成员也能看详情),10 私有(只有成员看得到)。
+ */
 class GroupInfo extends Model
 class GroupInfo extends Model
 {
 {
     use HasFactory;
     use HasFactory;
 
 
     protected $primaryKey = 'uid';
     protected $primaryKey = 'uid';
 
 
+    /** 主键是 uuid:不声明的话关系预加载会按整数走 whereIntegerInRaw,把 uuid 全转成 0 */
+    protected $keyType = 'string';
+
     protected $casts = [
     protected $casts = [
         'uid' => 'string',
         'uid' => 'string',
     ];
     ];
+
+    public const STATUS_PRIVATE = 10;
+
+    public const STATUS_PUBLIC = 30;
+
+    /**
+     * 创建者(拥有者)。`owner` 是用户 uuid,对 `user_infos.userid`。
+     */
+    public function creator(): BelongsTo
+    {
+        return $this->belongsTo(UserInfo::class, 'owner', 'userid');
+    }
+
+    /**
+     * 共享给这个团队的资源(「团队文档」)。`shares.cooperator_id` 对团队 uid。
+     */
+    public function shares(): HasMany
+    {
+        return $this->hasMany(Share::class, 'cooperator_id', 'uid');
+    }
+
+    /**
+     * 团队成员。嵌套路由 `groups/{group}/members/{member}` 靠它做 scoped 绑定。
+     */
+    public function members(): HasMany
+    {
+        return $this->hasMany(GroupMember::class, 'group_id', 'uid');
+    }
 }
 }

+ 65 - 0
api-v13/app/Models/GroupMember.php

@@ -4,14 +4,79 @@ namespace App\Models;
 
 
 use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
 
 
+/**
+ * 团队(group)成员。表 `group_members`。
+ *
+ * 角色有两列:v2 的 `power`(0 owner / 1 manager / 2 member)与 v3 的 `role`
+ * (owner / manager / editor / reader)。v2 只会插入、从不改 power;v3 改角色时两列同写。
+ * 读角色一律走 {@see self::effectiveRole()}。
+ */
 class GroupMember extends Model
 class GroupMember extends Model
 {
 {
     use HasFactory;
     use HasFactory;
 
 
+    public const ROLE_OWNER = 'owner';
+
+    public const ROLE_MANAGER = 'manager';
+
+    public const ROLE_EDITOR = 'editor';
+
+    public const ROLE_READER = 'reader';
+
+    /** v3 可以分配的角色;owner 只在建团队时产生,不能经改角色得到 */
+    public const ASSIGNABLE_ROLES = [self::ROLE_MANAGER, self::ROLE_EDITOR, self::ROLE_READER];
+
     protected $primaryKey = 'id';
     protected $primaryKey = 'id';
 
 
     protected $casts = [
     protected $casts = [
         'id' => 'string',
         'id' => 'string',
     ];
     ];
+
+    /**
+     * 实际角色:`role` 有值就用它,为空按 v2 的 `power` 推导。
+     *
+     * TODO v4 下线后:按 power 回填 role、列改 NOT NULL,删掉这段推导直接读 role。
+     */
+    public function effectiveRole(): string
+    {
+        if ($this->role) {
+            return $this->role;
+        }
+
+        return match ((int) $this->power) {
+            0 => self::ROLE_OWNER,
+            1 => self::ROLE_MANAGER,
+            default => self::ROLE_READER,
+        };
+    }
+
+    /**
+     * 与角色对应的 v2 `power`,v3 改角色时同写,让 v4 的显示与删除权限保持一致。
+     */
+    public static function powerOf(string $role): int
+    {
+        return match ($role) {
+            self::ROLE_OWNER => 0,
+            self::ROLE_MANAGER => 1,
+            default => 2,
+        };
+    }
+
+    /**
+     * 成员本人。`user_id` 是 uuid,对 `user_infos.userid`。
+     */
+    public function user(): BelongsTo
+    {
+        return $this->belongsTo(UserInfo::class, 'user_id', 'userid');
+    }
+
+    /**
+     * 所属团队。`group_id` 对 `group_infos.uid`。
+     */
+    public function group(): BelongsTo
+    {
+        return $this->belongsTo(GroupInfo::class, 'group_id', 'uid');
+    }
 }
 }

+ 88 - 0
api-v13/app/Services/V3/GroupAbilityService.php

@@ -0,0 +1,88 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Models\GroupMember;
+
+/**
+ * 团队空间的权限判定:「某人对某个 owner 名下的资源能做什么」。
+ *
+ * owner 是本人 → 什么都能做;owner 是一个团队 → 按此人在团队里的角色查表;
+ * 其余 → 什么都不能做。资源自己的协作(share 表)不在这里管,由各资源的 Service 叠加。
+ *
+ * 只给 v3 用。v2 的权限判定(`ShareApi`、`ChecksChannelEditPower` …)只认
+ * 「owner 就是本人」,不改它——见 CLAUDE.md 铁律 2。
+ */
+class GroupAbilityService
+{
+    /** 看得到 owner 名下的资源 */
+    public const READ = 'read';
+
+    /** 在 owner 名下新建资源 */
+    public const CREATE = 'create';
+
+    /** 修改 owner 名下的资源(含 channel 里的译文、术语等内容) */
+    public const UPDATE = 'update';
+
+    /** 删除 owner 名下的资源 */
+    public const DELETE = 'delete';
+
+    /** 加人、移人、改成员角色 */
+    public const MANAGE_MEMBERS = 'manage_members';
+
+    /** 改团队本身的名称、简介、公开状态;从团队文档里移除共享 */
+    public const MANAGE_GROUP = 'manage_group';
+
+    /** 删除团队本身(区别于删除团队名下的资源) */
+    public const DELETE_GROUP = 'delete_group';
+
+    /** @var array<string, list<string>> */
+    private const ABILITIES = [
+        GroupMember::ROLE_OWNER => [
+            self::READ, self::CREATE, self::UPDATE, self::DELETE,
+            self::MANAGE_MEMBERS, self::MANAGE_GROUP, self::DELETE_GROUP,
+        ],
+        GroupMember::ROLE_MANAGER => [self::READ, self::CREATE, self::UPDATE, self::MANAGE_MEMBERS, self::MANAGE_GROUP],
+        GroupMember::ROLE_EDITOR => [self::READ, self::UPDATE],
+        GroupMember::ROLE_READER => [self::READ],
+    ];
+
+    /**
+     * 某人对某个 owner(用户或团队的 uuid)能不能做某件事。
+     */
+    public function can(string $userUid, string $ownerUid, string $ability): bool
+    {
+        if ($userUid === $ownerUid) {
+            return true;
+        }
+
+        return self::roleAllows($this->roleIn($userUid, $ownerUid), $ability);
+    }
+
+    /**
+     * 此人在团队里的角色;不是成员(或 owner 根本不是团队)返回 null。
+     */
+    public function roleIn(string $userUid, string $groupUid): ?string
+    {
+        return $this->membership($userUid, $groupUid)?->effectiveRole();
+    }
+
+    /**
+     * 此人在团队里的成员记录;不是成员返回 null。
+     */
+    public function membership(string $userUid, string $groupUid): ?GroupMember
+    {
+        // 不做缓存:控制器实例会被路由缓存、Service 跟着跨请求存活,缓存会让改过的角色迟迟不生效
+        return GroupMember::where('group_id', $groupUid)
+            ->where('user_id', $userUid)
+            ->first();
+    }
+
+    /**
+     * 角色是否包含某项能力。null(不是成员)一律不包含。
+     */
+    public static function roleAllows(?string $role, string $ability): bool
+    {
+        return $role !== null && in_array($ability, self::ABILITIES[$role] ?? [], true);
+    }
+}

+ 169 - 0
api-v13/app/Services/V3/GroupMemberService.php

@@ -0,0 +1,169 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Models\GroupInfo;
+use App\Models\GroupMember;
+use App\Models\UserInfo;
+use App\Services\UserService;
+use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Contracts\Pagination\LengthAwarePaginator;
+use Illuminate\Validation\ValidationException;
+
+/**
+ * 团队成员的业务逻辑:我加入的团队、成员列表、加人、改角色、移人 / 退出。
+ *
+ * 取代 v2 `GroupMemberController` 的 view=user / view=group / store / destroy。
+ * v2 那份原地保留不动(铁律 2),两边不共用代码。
+ *
+ * 规则:
+ * - 看成员列表:任何成员
+ * - 加人、移人、改角色:owner 与 manager({@see GroupAbilityService::MANAGE_MEMBERS})
+ * - owner 那一行谁都不能改、不能移;本人可以退出(owner 除外)
+ * - 改角色时 role 与 power 同写,v4 看到的身份与 v3 一致
+ */
+class GroupMemberService
+{
+    public function __construct(private readonly GroupAbilityService $abilities) {}
+
+    /**
+     * 我加入的团队,按加入时间排序。
+     *
+     * `owned`:true 只要我创建的,false 只要我参加的别人的团队(取代 v2 的 view2 与
+     * `group-my-number`——数量读分页的 total)。`search`:按团队名模糊匹配。
+     *
+     * @param  array{owned?: bool, search?: string|null}  $filters
+     * @return LengthAwarePaginator<int, GroupMember>
+     */
+    public function listForUser(string $userUid, array $filters, int $perPage): LengthAwarePaginator
+    {
+        return GroupMember::with([
+            'group:uid,name,description,owner,status,created_at',
+            'group.'.UserService::eagerLoadActor('creator')[0],
+        ])
+            ->where('user_id', $userUid)
+            ->whereHas('group', function ($query) use ($userUid, $filters) {
+                if (array_key_exists('owned', $filters)) {
+                    $query->where('owner', $filters['owned'] ? '=' : '<>', $userUid);
+                }
+                if (! empty($filters['search'])) {
+                    $query->where('name', 'ilike', '%'.$filters['search'].'%');
+                }
+            })
+            ->orderBy('created_at')
+            ->orderBy('id')
+            ->paginate($perPage);
+    }
+
+    /**
+     * 团队的成员列表,只有成员看得到。
+     *
+     * @return LengthAwarePaginator<int, GroupMember>
+     *
+     * @throws AuthorizationException 不是成员
+     */
+    public function listForGroup(GroupInfo $group, string $viewerUid, int $perPage): LengthAwarePaginator
+    {
+        if (! $this->abilities->membership($viewerUid, $group->uid)) {
+            throw new AuthorizationException(__('messages.group_not_member'));
+        }
+
+        return $group->members()
+            ->with(UserService::eagerLoadActor()[0])
+            ->orderBy('power')
+            ->orderBy('created_at')
+            ->orderBy('id')
+            ->paginate($perPage);
+    }
+
+    /**
+     * 加一名成员。
+     *
+     * @param  array{user_id: string, role?: string}  $data
+     *
+     * @throws AuthorizationException 调用者不能管理成员
+     * @throws ValidationException 用户不存在或已是成员
+     */
+    public function add(GroupInfo $group, string $actorUid, array $data): GroupMember
+    {
+        $this->authorizeManage($group, $actorUid);
+
+        if (! UserInfo::where('userid', $data['user_id'])->exists()) {
+            throw ValidationException::withMessages(['user_id' => __('messages.group_user_not_found')]);
+        }
+        if ($group->members()->where('user_id', $data['user_id'])->exists()) {
+            throw ValidationException::withMessages(['user_id' => __('messages.group_member_exists')]);
+        }
+
+        $role = $data['role'] ?? GroupMember::ROLE_READER;
+        $member = new GroupMember;
+        $member->forceFill([
+            'id' => app('snowflake')->id(),
+            'user_id' => $data['user_id'],
+            'group_id' => $group->uid,
+            'group_name' => $group->name,
+            'role' => $role,
+            'power' => GroupMember::powerOf($role),
+        ])->save();
+
+        return $member->load(UserService::eagerLoadActor()[0]);
+    }
+
+    /**
+     * 改成员角色。
+     *
+     * @param  array{role?: string}  $data
+     *
+     * @throws AuthorizationException 调用者不能管理成员,或目标是 owner
+     */
+    public function update(GroupInfo $group, GroupMember $member, string $actorUid, array $data): GroupMember
+    {
+        $this->authorizeManage($group, $actorUid);
+        $this->guardOwner($member);
+
+        if (isset($data['role'])) {
+            $member->forceFill([
+                'role' => $data['role'],
+                'power' => GroupMember::powerOf($data['role']),
+            ])->save();
+        }
+
+        return $member->load(UserService::eagerLoadActor()[0]);
+    }
+
+    /**
+     * 移除成员,或本人退出。owner 不能被移除、也不能退出。
+     *
+     * @throws AuthorizationException
+     */
+    public function remove(GroupInfo $group, GroupMember $member, string $actorUid): void
+    {
+        $this->guardOwner($member);
+        if ($member->user_id !== $actorUid) {
+            $this->authorizeManage($group, $actorUid);
+        }
+
+        $member->delete();
+    }
+
+    /**
+     * @throws AuthorizationException
+     */
+    private function authorizeManage(GroupInfo $group, string $actorUid): void
+    {
+        $role = $this->abilities->roleIn($actorUid, $group->uid);
+        if (! GroupAbilityService::roleAllows($role, GroupAbilityService::MANAGE_MEMBERS)) {
+            throw new AuthorizationException(__('messages.group_forbidden'));
+        }
+    }
+
+    /**
+     * @throws AuthorizationException
+     */
+    private function guardOwner(GroupMember $member): void
+    {
+        if ($member->effectiveRole() === GroupMember::ROLE_OWNER) {
+            throw new AuthorizationException(__('messages.group_owner_immutable'));
+        }
+    }
+}

+ 253 - 0
api-v13/app/Services/V3/GroupService.php

@@ -0,0 +1,253 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Exceptions\BusinessException;
+use App\Models\AiModel;
+use App\Models\Article;
+use App\Models\Attachment;
+use App\Models\Channel;
+use App\Models\Collection;
+use App\Models\Commentary;
+use App\Models\Course;
+use App\Models\CustomBook;
+use App\Models\CustomBookSentence;
+use App\Models\DhammaTerm;
+use App\Models\DictInfo;
+use App\Models\GroupInfo;
+use App\Models\GroupMember;
+use App\Models\Project;
+use App\Models\SentBlock;
+use App\Models\Share;
+use App\Models\Tag;
+use App\Models\TagMap;
+use App\Models\Task;
+use App\Services\UserService;
+use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Contracts\Pagination\LengthAwarePaginator;
+use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Str;
+use Illuminate\Validation\ValidationException;
+
+/**
+ * 团队本身:搜公开团队、看详情、建、改、删。
+ *
+ * 取代 v2 `GroupController`(index 的 view=all、show、store、update、destroy)。
+ * 「我的团队」列表在 {@see GroupMemberService::listForUser()}(载荷是成员记录)。
+ * v2 那份原地保留不动(铁律 2),两边不共用代码。
+ */
+class GroupService
+{
+    /**
+     * 可能以团队为 owner 的表:删团队前逐表检查,名下还有东西就拒绝。
+     * 只列 owner 列存 uuid 的;articles / collections 的 owner_id 是整数用户 id,不算。
+     *
+     * @var array<string, array{0: class-string, 1: string}>
+     */
+    private const OWNED = [
+        'channel' => [Channel::class, 'owner_uid'],
+        'article' => [Article::class, 'owner'],
+        'collection' => [Collection::class, 'owner'],
+        'term' => [DhammaTerm::class, 'owner'],
+        'course' => [Course::class, 'studio_id'],
+        'project' => [Project::class, 'owner_id'],
+        'task' => [Task::class, 'owner_id'],
+        'tag' => [Tag::class, 'owner_id'],
+        'tag_map' => [TagMap::class, 'owner_uid'],
+        'attachment' => [Attachment::class, 'owner_uid'],
+        'ai_model' => [AiModel::class, 'owner_id'],
+        'custom_book' => [CustomBook::class, 'owner'],
+        'custom_book_sentence' => [CustomBookSentence::class, 'owner'],
+        'dict' => [DictInfo::class, 'owner_id'],
+        'commentary' => [Commentary::class, 'owner_id'],
+        'sent_block' => [SentBlock::class, 'owner_uid'],
+    ];
+
+    public function __construct(private readonly GroupAbilityService $abilities) {}
+
+    /**
+     * 按名字搜公开团队(共享资源时挑团队用)。私有团队不出现。
+     *
+     * @return LengthAwarePaginator<int, GroupInfo>
+     */
+    public function searchPublic(?string $search, int $perPage): LengthAwarePaginator
+    {
+        return $this->withCreator()
+            ->where('status', '>=', GroupInfo::STATUS_PUBLIC)
+            ->when($search, fn (Builder $query, string $value) => $query->where('name', 'ilike', '%'.$value.'%'))
+            ->orderBy('name')
+            ->orderBy('uid')
+            ->paginate($perPage);
+    }
+
+    /**
+     * 团队详情:公开团队谁都能看,私有团队只有成员能看。附上查看者的角色。
+     *
+     * @throws AuthorizationException 私有团队且不是成员
+     */
+    public function show(GroupInfo $group, ?string $viewerUid): GroupInfo
+    {
+        $role = $viewerUid ? $this->abilities->roleIn($viewerUid, $group->uid) : null;
+        if ($role === null && $group->status < GroupInfo::STATUS_PUBLIC) {
+            throw new AuthorizationException(__('messages.group_not_member'));
+        }
+
+        return $this->withViewerRole($group->load(UserService::eagerLoadActor('creator')[0]), $role);
+    }
+
+    /**
+     * 建团队,建的人成为 owner。同一个人名下不能重名。
+     *
+     * @param  array{name: string, description?: string|null, status?: int}  $data
+     *
+     * @throws ValidationException 重名
+     */
+    public function create(string $userUid, array $data): GroupInfo
+    {
+        $this->guardUniqueName($userUid, $data['name']);
+
+        $group = DB::transaction(function () use ($userUid, $data) {
+            $now = time() * 1000;
+            $group = new GroupInfo;
+            $group->forceFill([
+                'id' => app('snowflake')->id(),
+                'uid' => (string) Str::uuid(),
+                'name' => $data['name'],
+                'description' => $data['description'] ?? null,
+                'status' => $data['status'] ?? GroupInfo::STATUS_PUBLIC,
+                'owner' => $userUid,
+                'create_time' => $now,
+                'modify_time' => $now,
+            ])->save();
+
+            (new GroupMember)->forceFill([
+                'id' => app('snowflake')->id(),
+                'user_id' => $userUid,
+                'group_id' => $group->uid,
+                'group_name' => $group->name,
+                'role' => GroupMember::ROLE_OWNER,
+                'power' => GroupMember::powerOf(GroupMember::ROLE_OWNER),
+            ])->save();
+
+            return $group;
+        });
+
+        return $this->withViewerRole($group->load(UserService::eagerLoadActor('creator')[0]), GroupMember::ROLE_OWNER);
+    }
+
+    /**
+     * 改团队信息(owner / manager)。只改传了的字段;改名时同步成员记录上冗余的团队名。
+     *
+     * @param  array{name?: string, description?: string|null, status?: int}  $data
+     *
+     * @throws AuthorizationException
+     * @throws ValidationException 重名
+     */
+    public function update(GroupInfo $group, string $actorUid, array $data): GroupInfo
+    {
+        $role = $this->authorize($group, $actorUid, GroupAbilityService::MANAGE_GROUP);
+        if (isset($data['name']) && $data['name'] !== $group->name) {
+            $this->guardUniqueName($group->owner, $data['name'], $group->uid);
+        }
+
+        DB::transaction(function () use ($group, $data) {
+            $group->forceFill($data + ['modify_time' => time() * 1000])->save();
+            if (isset($data['name'])) {
+                $group->members()->update(['group_name' => $data['name']]);
+            }
+        });
+
+        return $this->withViewerRole($group->load(UserService::eagerLoadActor('creator')[0]), $role);
+    }
+
+    /**
+     * 删团队(只有 owner)。名下还有资源就拒绝;否则连同成员记录与共享给它的 share 一起硬删。
+     *
+     * @throws AuthorizationException
+     * @throws BusinessException 名下还有资源(409)
+     */
+    public function delete(GroupInfo $group, string $actorUid): void
+    {
+        $this->authorize($group, $actorUid, GroupAbilityService::DELETE_GROUP);
+
+        $owned = $this->ownedResources($group->uid);
+        if ($owned !== []) {
+            throw new BusinessException(
+                __('messages.group_has_resources'),
+                409,
+                'group-has-resources',
+                ['resources' => $owned],
+            );
+        }
+
+        DB::transaction(function () use ($group) {
+            $group->shares()->delete();
+            $group->members()->delete();
+            $group->delete();
+        });
+    }
+
+    /**
+     * 团队名下各类资源的条数,只列有的。
+     *
+     * @return array<string, int>
+     */
+    public function ownedResources(string $groupUid): array
+    {
+        $counts = [];
+        foreach (self::OWNED as $type => [$model, $column]) {
+            $count = $model::query()->where($column, $groupUid)->count();
+            if ($count > 0) {
+                $counts[$type] = $count;
+            }
+        }
+
+        return $counts;
+    }
+
+    /**
+     * @return Builder<GroupInfo>
+     */
+    private function withCreator(): Builder
+    {
+        return GroupInfo::query()->with(UserService::eagerLoadActor('creator')[0]);
+    }
+
+    /**
+     * 查看者的角色挂在模型上给 Resource 读,Resource 不查库。
+     */
+    private function withViewerRole(GroupInfo $group, ?string $role): GroupInfo
+    {
+        $group->setAttribute('viewer_role', $role);
+
+        return $group;
+    }
+
+    /**
+     * @throws AuthorizationException
+     */
+    private function authorize(GroupInfo $group, string $actorUid, string $ability): string
+    {
+        $role = $this->abilities->roleIn($actorUid, $group->uid);
+        if (! GroupAbilityService::roleAllows($role, $ability)) {
+            throw new AuthorizationException(__('messages.group_forbidden'));
+        }
+
+        return $role;
+    }
+
+    /**
+     * @throws ValidationException
+     */
+    private function guardUniqueName(string $ownerUid, string $name, ?string $exceptUid = null): void
+    {
+        $exists = GroupInfo::where('owner', $ownerUid)
+            ->where('name', $name)
+            ->when($exceptUid, fn (Builder $query, string $uid) => $query->where('uid', '<>', $uid))
+            ->exists();
+        if ($exists) {
+            throw ValidationException::withMessages(['name' => __('messages.group_name_exists')]);
+        }
+    }
+}

+ 122 - 0
api-v13/app/Services/V3/GroupShareService.php

@@ -0,0 +1,122 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Models\AiModel;
+use App\Models\Article;
+use App\Models\Channel;
+use App\Models\Collection;
+use App\Models\GroupInfo;
+use App\Models\Project;
+use App\Models\Share;
+use App\Services\UserService;
+use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Contracts\Pagination\LengthAwarePaginator;
+
+/**
+ * 团队文档:共享给某个团队的资源(`shares` 表里 cooperator 是这个团队的行)。
+ *
+ * 取代 v2 `ShareController@index` 的 view=group,以及团队页上经 `DELETE /v2/share/{id}`
+ * 把资源移出团队。资源本身的协作者管理(view=res、给人加共享)仍是 v2 share 资源,不在这里。
+ *
+ * 规则:成员都能看;团队的 owner / manager 或资源的拥有者能把资源移出团队。
+ */
+class GroupShareService
+{
+    /** shares.res_type 的编号 → 对外的类型名,以及取标题、拥有者的列 */
+    private const TYPES = [
+        1 => ['pcs', null, null, null],
+        2 => ['channel', Channel::class, 'name', 'owner_uid'],
+        3 => ['article', Article::class, 'title', 'owner'],
+        4 => ['collection', Collection::class, 'title', 'owner'],
+        5 => ['fragment', null, null, null],
+        6 => ['workflow', Project::class, 'title', 'owner_id'],
+        7 => ['project', Project::class, 'title', 'owner_id'],
+        8 => ['ai_model', AiModel::class, 'name', 'owner_id'],
+    ];
+
+    public function __construct(
+        private readonly GroupAbilityService $abilities,
+        private readonly UserService $users,
+    ) {}
+
+    /**
+     * 团队文档列表,每条附上资源的类型、标题与拥有者(按类型批量取,不逐行查)。
+     *
+     * @return LengthAwarePaginator<int, Share>
+     *
+     * @throws AuthorizationException 不是成员
+     */
+    public function list(GroupInfo $group, string $viewerUid, int $perPage): LengthAwarePaginator
+    {
+        if (! $this->abilities->membership($viewerUid, $group->uid)) {
+            throw new AuthorizationException(__('messages.group_not_member'));
+        }
+
+        $page = $group->shares()->orderByDesc('created_at')->orderBy('id')->paginate($perPage);
+        $this->attachResources($page->getCollection()->all());
+
+        return $page;
+    }
+
+    /**
+     * 把资源移出团队:团队的 owner / manager,或资源的拥有者。
+     *
+     * @throws AuthorizationException
+     */
+    public function remove(GroupInfo $group, Share $share, string $actorUid): void
+    {
+        $this->attachResources([$share]);
+        $isResourceOwner = ($share->getAttribute('resource')['owner_id'] ?? null) === $actorUid;
+        if (! $isResourceOwner) {
+            $role = $this->abilities->roleIn($actorUid, $group->uid);
+            if (! GroupAbilityService::roleAllows($role, GroupAbilityService::MANAGE_GROUP)) {
+                throw new AuthorizationException(__('messages.group_forbidden'));
+            }
+        }
+
+        $share->delete();
+    }
+
+    /**
+     * 按资源类型批量取标题与拥有者,挂到每行的 `resource` 属性上给 Resource 读。
+     * 资源已被删掉的,title / owner_id / owner 为 null;拥有者是团队(不是人)时 owner 为 null。
+     *
+     * @param  list<Share>  $shares
+     */
+    private function attachResources(array $shares): void
+    {
+        $byType = [];
+        foreach ($shares as $share) {
+            $byType[(int) $share->res_type][] = $share->res_id;
+        }
+
+        $found = [];
+        foreach ($byType as $type => $ids) {
+            [, $model, $titleColumn, $ownerColumn] = self::TYPES[$type] ?? [null, null, null, null];
+            if (! $model) {
+                continue;
+            }
+            foreach ($model::query()->whereIn('uid', array_unique($ids))->get(['uid', $titleColumn, $ownerColumn]) as $row) {
+                $found[$type][$row->uid] = ['title' => $row->{$titleColumn}, 'owner_id' => (string) $row->{$ownerColumn}];
+            }
+        }
+
+        $owners = $this->users->byUuids(array_merge(
+            [],
+            ...array_map(fn (array $rows) => array_column($rows, 'owner_id'), array_values($found)),
+        ));
+
+        foreach ($shares as $share) {
+            $type = (int) $share->res_type;
+            $ownerId = $found[$type][$share->res_id]['owner_id'] ?? null;
+            $share->setAttribute('resource', [
+                'type' => self::TYPES[$type][0] ?? 'unknown',
+                'id' => $share->res_id,
+                'title' => $found[$type][$share->res_id]['title'] ?? null,
+                'owner_id' => $ownerId,
+                'owner' => $ownerId ? ($owners[$ownerId] ?? null) : null,
+            ]);
+        }
+    }
+}

+ 33 - 0
api-v13/database/migrations/2026_11_13_080428_add_role_to_group_members_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+/**
+ * 团队成员的角色(团队空间)。
+ *
+ * v2 只有 power(0 owner / 1 manager / 2 member)且只会插入、从不修改;v3 新增
+ * editor(只能改、不能建删)与 reader(只读),v2 表达不了,所以另起一列。
+ *
+ * 不给默认值:v2 建团队时写入的创建者行(power 0)也会套上默认值,变成只读。
+ * 为空时按 power 推导,见 GroupMember::effectiveRole()。
+ * v4 下线后:按 power 回填空值、改 NOT NULL、删掉那段推导。
+ */
+return new class extends Migration
+{
+    public function up(): void
+    {
+        Schema::table('group_members', function (Blueprint $table) {
+            $table->string('role', 16)->nullable()
+                ->comment('团队角色 owner/manager/editor/reader;为空按 power 推导(v2 写入的行,v4 下线后回填并改 NOT NULL)');
+        });
+    }
+
+    public function down(): void
+    {
+        Schema::table('group_members', function (Blueprint $table) {
+            $table->dropColumn('role');
+        });
+    }
+};

+ 8 - 0
api-v13/resources/lang/en/messages.php

@@ -53,4 +53,12 @@ return [
     'stats_range_too_long' => 'The date range can be at most :days days.',
     'stats_range_too_long' => 'The date range can be at most :days days.',
     'agent_feedback_tags' => 'These tags do not match the rating.',
     'agent_feedback_tags' => 'These tags do not match the rating.',
 
 
+    'group_forbidden' => 'Your role in this team does not allow this action.',
+    'group_user_not_found' => 'No such user.',
+    'group_member_exists' => 'This user is already a member of the team.',
+    'group_owner_immutable' => 'The team owner cannot be changed or removed.',
+    'group_not_member' => 'You are not a member of this team.',
+    'group_has_resources' => 'The team still owns resources. Transfer or delete them before deleting the team.',
+    'group_name_exists' => 'You already have a team with this name.',
+    'group_share_not_found' => 'This resource is not shared with this team.',
 ];
 ];

+ 8 - 0
api-v13/resources/lang/zh-Hans/messages.php

@@ -53,4 +53,12 @@ return [
     'stats_range_too_long' => '时间范围最多 :days 天。',
     'stats_range_too_long' => '时间范围最多 :days 天。',
     'agent_feedback_tags' => '标签和评价不配套。',
     'agent_feedback_tags' => '标签和评价不配套。',
 
 
+    'group_forbidden' => '你在这个团队里的角色不能执行这个操作。',
+    'group_user_not_found' => '没有这个用户。',
+    'group_member_exists' => '这个用户已经是团队成员了。',
+    'group_owner_immutable' => '团队拥有者不能被修改或移除。',
+    'group_not_member' => '你不是这个团队的成员。',
+    'group_has_resources' => '团队名下还有资源,请先转让或删除它们再删除团队。',
+    'group_name_exists' => '你名下已经有同名的团队了。',
+    'group_share_not_found' => '这项资源没有共享给这个团队。',
 ];
 ];

+ 1 - 0
api-v13/routes/api.php

@@ -354,6 +354,7 @@ Route::prefix('v3')->as('v3.')->middleware(NegotiateLocale::class)->group(functi
     require __DIR__.'/v3/search.php';
     require __DIR__.'/v3/search.php';
     require __DIR__.'/v3/tipitaka.php';
     require __DIR__.'/v3/tipitaka.php';
     require __DIR__.'/v3/channel.php';
     require __DIR__.'/v3/channel.php';
+    require __DIR__.'/v3/group.php';
     require __DIR__.'/v3/interaction.php';
     require __DIR__.'/v3/interaction.php';
     require __DIR__.'/v3/auth.php';
     require __DIR__.'/v3/auth.php';
     require __DIR__.'/v3/agent.php';
     require __DIR__.'/v3/agent.php';

+ 50 - 0
api-v13/routes/v3/group.php

@@ -0,0 +1,50 @@
+<?php
+
+/*
+|--------------------------------------------------------------------------
+| v3 · group —— 团队(界面上叫「团队」,团队空间以它为 owner)
+|--------------------------------------------------------------------------
+|
+| 由 routes/api.php 的 v3 组 require 进来,前缀已在那边加好。
+| 资源名沿用表名与 v2 的 group,不改叫 teams(2026-11-13 定)。
+|
+*/
+
+use App\Http\Controllers\V3\GroupController;
+use App\Http\Controllers\V3\GroupMemberController;
+use App\Http\Controllers\V3\GroupShareController;
+use App\Http\Controllers\V3\MeGroupController;
+use Illuminate\Support\Facades\Route;
+
+// 我加入的团队:没有第二个主体(不会出现 me 以外的值),所以是 /me/ 下的独立端点
+Route::get('me/groups', MeGroupController::class)->middleware('auth.v3')->name('me.groups.index');
+
+// 团队本身。详情可不登录(公开团队谁都能看),其余要登录。只注册 PATCH,不注册 PUT
+Route::apiResource('groups', GroupController::class)
+    ->except(['update'])
+    ->middlewareFor(['index', 'store', 'destroy'], 'auth.v3')
+    ->whereUuid('group');
+Route::patch('groups/{group}', [GroupController::class, 'update'])
+    ->name('groups.update')
+    ->middleware('auth.v3')
+    ->whereUuid('group');
+
+// 团队成员。scopeBindings:{member} 必须属于 {group},否则 404。
+// 用组而不是 apiResource()->scoped():后者会把 URI 写成 {group:},规格生成器认不出。
+// 只注册 PATCH,不注册 PUT(v3-resource skill 硬规范第 10 条)
+Route::middleware('auth.v3')->scopeBindings()->group(function () {
+    Route::apiResource('groups.members', GroupMemberController::class)
+        ->only(['index', 'store', 'destroy'])
+        ->whereUuid('group')
+        ->whereNumber('member');
+    Route::patch('groups/{group}/members/{member}', [GroupMemberController::class, 'update'])
+        ->name('groups.members.update')
+        ->whereUuid('group')
+        ->whereNumber('member');
+
+    // 团队文档(共享给团队的资源)。{share} 必须是共享给 {group} 的
+    Route::apiResource('groups.shares', GroupShareController::class)
+        ->only(['index', 'destroy'])
+        ->whereUuid('group')
+        ->whereNumber('share');
+});

+ 303 - 0
api-v13/tests/Feature/GroupMemberV3Test.php

@@ -0,0 +1,303 @@
+<?php
+
+use App\Models\GroupMember;
+use App\Services\V3\GroupAbilityService;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Str;
+
+uses(RefreshDatabase::class);
+
+/**
+ * v3 团队成员(团队空间的身份与角色)。
+ *
+ * 端点:
+ *   GET    /api/v3/me/groups                         我加入的团队,带我的角色
+ *   GET    /api/v3/groups/{group}/members            成员列表(成员可看)
+ *   POST   /api/v3/groups/{group}/members            加人(owner / manager)
+ *   PATCH  /api/v3/groups/{group}/members/{member}   改角色(owner / manager,owner 行不可改)
+ *   DELETE /api/v3/groups/{group}/members/{member}   移人 / 本人退出(owner 不可)
+ *
+ * 这里断言的是形状而非契约(spectator 未安装,见 v3-resource skill 第 3 步)。
+ */
+
+/* ---------------- 角色推导 ---------------- */
+
+it('derives roles from v2 power when role is empty', function (int $power, string $role) {
+    $member = (new GroupMember)->forceFill(['power' => $power]);
+
+    expect($member->effectiveRole())->toBe($role);
+})->with([
+    'owner' => [0, 'owner'],
+    'manager' => [1, 'manager'],
+    'member' => [2, 'reader'],
+]);
+
+it('prefers the role column over power', function () {
+    $member = (new GroupMember)->forceFill(['power' => 2, 'role' => 'editor']);
+
+    expect($member->effectiveRole())->toBe('editor');
+});
+
+it('maps roles to abilities', function (string $role, array $allowed) {
+    foreach (['read', 'create', 'update', 'delete', 'manage_members', 'manage_group', 'delete_group'] as $ability) {
+        expect(GroupAbilityService::roleAllows($role, $ability))
+            ->toBe(in_array($ability, $allowed, true), "{$role} / {$ability}");
+    }
+})->with([
+    'owner' => ['owner', ['read', 'create', 'update', 'delete', 'manage_members', 'manage_group', 'delete_group']],
+    'manager' => ['manager', ['read', 'create', 'update', 'manage_members', 'manage_group']],
+    'editor' => ['editor', ['read', 'update']],
+    'reader' => ['reader', ['read']],
+]);
+
+it('treats the owner uid itself as full ability and outsiders as none', function () {
+    [$team, $users] = makeTeam();
+    $abilities = app(GroupAbilityService::class);
+
+    expect($abilities->can($users['owner'], $users['owner'], 'delete'))->toBeTrue();
+    expect($abilities->can($users['editor'], $team, 'update'))->toBeTrue();
+    expect($abilities->can($users['editor'], $team, 'create'))->toBeFalse();
+    expect($abilities->can($users['outsider'], $team, 'read'))->toBeFalse();
+});
+
+/* ---------------- GET /me/groups ---------------- */
+
+it('lists my teams with my role', function () {
+    [$team, $users] = makeTeam();
+    makeGroup($users['outsider'], 'not mine');
+
+    $data = $this->getJson('/api/v3/me/groups', authHeader($users['editor']))
+        ->assertOk()
+        ->json('data');
+
+    expect($data)->toHaveCount(1);
+    expect($data[0])->toMatchArray(['id' => $team, 'name' => 'test team', 'role' => 'editor']);
+    expect($data[0])->toHaveKeys(['description', 'owner_id', 'joined_at']);
+    expect($data[0]['member_id'])->toBe(memberId($team, $users['editor']));
+});
+
+it('requires login for my teams', function () {
+    $this->getJson('/api/v3/me/groups')->assertUnauthorized();
+});
+
+/* ---------------- GET members ---------------- */
+
+it('lets any member list the members', function () {
+    [$team, $users] = makeTeam();
+
+    $data = $this->getJson("/api/v3/groups/{$team}/members", authHeader($users['reader']))
+        ->assertOk()
+        ->json('data');
+
+    $roles = array_column($data, 'role');
+    expect(array_slice($roles, 0, 2))->toBe(['owner', 'manager']);
+    expect(array_slice($roles, 2))->toEqualCanonicalizing(['editor', 'reader']);
+    expect($data[0])->toHaveKeys(['id', 'group_id', 'role', 'joined_at', 'user']);
+    expect($data[0]['id'])->toBeString();
+    expect($data[0]['user']['id'])->toBe($users['owner']);
+});
+
+it('hides the member list from outsiders', function () {
+    [$team, $users] = makeTeam();
+
+    $this->getJson("/api/v3/groups/{$team}/members", authHeader($users['outsider']))
+        ->assertForbidden();
+});
+
+it('answers 401 before looking the team up', function () {
+    // 认证要排在路由模型绑定之前:未登录不该靠 404 / 200 探出团队是否存在
+    $this->getJson('/api/v3/groups/'.Str::uuid().'/members')->assertUnauthorized();
+});
+
+it('returns 404 for an unknown team', function () {
+    $this->getJson('/api/v3/groups/'.Str::uuid().'/members', authHeader(makeStudio('someone')))
+        ->assertNotFound();
+});
+
+it('does not query per member', function () {
+    $countQueriesFor = function (int $extra): int {
+        [$team, $users] = makeTeam();
+        for ($i = 0; $i < $extra; $i++) {
+            addGroupMember($team, makeStudio('extra-'.Str::random(8)));
+        }
+        DB::flushQueryLog();
+        DB::enableQueryLog();
+        $this->getJson("/api/v3/groups/{$team}/members", authHeader($users['reader']))->assertOk();
+        $count = count(DB::getQueryLog());
+        DB::disableQueryLog();
+
+        return $count;
+    };
+
+    expect($countQueriesFor(10))->toBe($countQueriesFor(0));
+});
+
+/* ---------------- POST members ---------------- */
+
+it('lets owners and managers add members, defaulting to reader', function (string $actor) {
+    [$team, $users] = makeTeam();
+    $newcomer = makeStudio('newcomer-'.Str::random(6));
+
+    $this->postJson("/api/v3/groups/{$team}/members", ['user_id' => $newcomer], authHeader($users[$actor]))
+        ->assertCreated()
+        ->assertJsonPath('data.role', 'reader')
+        ->assertJsonPath('data.user.id', $newcomer);
+
+    $row = GroupMember::where('group_id', $team)->where('user_id', $newcomer)->first();
+    expect($row->role)->toBe('reader');
+    expect((int) $row->power)->toBe(2);
+})->with(['owner', 'manager']);
+
+it('adds a member with a given role and keeps power in sync', function () {
+    [$team, $users] = makeTeam();
+    $newcomer = makeStudio('newcomer');
+
+    $this->postJson("/api/v3/groups/{$team}/members", ['user_id' => $newcomer, 'role' => 'manager'], authHeader($users['owner']))
+        ->assertCreated()
+        ->assertJsonPath('data.role', 'manager');
+
+    expect((int) GroupMember::where('user_id', $newcomer)->value('power'))->toBe(1);
+});
+
+it('does not let editors, readers or outsiders add members', function (string $actor) {
+    [$team, $users] = makeTeam();
+    $newcomer = makeStudio('newcomer');
+
+    $this->postJson("/api/v3/groups/{$team}/members", ['user_id' => $newcomer], authHeader($users[$actor]))
+        ->assertForbidden();
+
+    expect(GroupMember::where('user_id', $newcomer)->exists())->toBeFalse();
+})->with(['editor', 'reader', 'outsider']);
+
+it('rejects invalid additions', function (array $payload, string $field) {
+    [$team, $users] = makeTeam();
+    $payload = array_map(fn ($value) => $value === ':editor' ? $users['editor'] : $value, $payload);
+
+    $this->postJson("/api/v3/groups/{$team}/members", $payload, authHeader($users['owner']))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors($field);
+})->with([
+    'missing user' => [[], 'user_id'],
+    'not a uuid' => [['user_id' => 'abc'], 'user_id'],
+    'unknown user' => [['user_id' => '00000000-0000-4000-8000-000000000000'], 'user_id'],
+    'already a member' => [['user_id' => ':editor'], 'user_id'],
+    'owner role' => [['user_id' => '00000000-0000-4000-8000-000000000000', 'role' => 'owner'], 'role'],
+]);
+
+it('requires login to add members', function () {
+    [$team] = makeTeam();
+
+    $this->postJson("/api/v3/groups/{$team}/members", ['user_id' => (string) Str::uuid()])
+        ->assertUnauthorized();
+});
+
+/* ---------------- PATCH members ---------------- */
+
+it('lets managers change roles, including to manager', function () {
+    [$team, $users] = makeTeam();
+    $reader = memberId($team, $users['reader']);
+
+    $this->patchJson("/api/v3/groups/{$team}/members/{$reader}", ['role' => 'manager'], authHeader($users['manager']))
+        ->assertOk()
+        ->assertJsonPath('data.role', 'manager');
+
+    $row = GroupMember::find($reader);
+    expect($row->role)->toBe('manager');
+    expect((int) $row->power)->toBe(1);
+});
+
+it('demotes a v2 manager to editor with power kept at member level', function () {
+    [$team, $users] = makeTeam();
+    $manager = memberId($team, $users['manager']);
+
+    $this->patchJson("/api/v3/groups/{$team}/members/{$manager}", ['role' => 'editor'], authHeader($users['owner']))
+        ->assertOk()
+        ->assertJsonPath('data.role', 'editor');
+
+    expect((int) GroupMember::find($manager)->power)->toBe(2);
+});
+
+it('never changes the owner row', function () {
+    [$team, $users] = makeTeam();
+    $owner = memberId($team, $users['owner']);
+
+    $this->patchJson("/api/v3/groups/{$team}/members/{$owner}", ['role' => 'reader'], authHeader($users['manager']))
+        ->assertForbidden();
+
+    expect(GroupMember::find($owner)->effectiveRole())->toBe('owner');
+});
+
+it('does not let editors change roles', function () {
+    [$team, $users] = makeTeam();
+    $reader = memberId($team, $users['reader']);
+
+    $this->patchJson("/api/v3/groups/{$team}/members/{$reader}", ['role' => 'editor'], authHeader($users['editor']))
+        ->assertForbidden();
+});
+
+it('rejects assigning the owner role', function () {
+    [$team, $users] = makeTeam();
+    $reader = memberId($team, $users['reader']);
+
+    $this->patchJson("/api/v3/groups/{$team}/members/{$reader}", ['role' => 'owner'], authHeader($users['owner']))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors('role');
+});
+
+it('returns 404 for a member of another team', function () {
+    [$team, $users] = makeTeam();
+    [$otherTeam, $otherUsers] = makeTeam();
+    $stranger = memberId($otherTeam, $otherUsers['reader']);
+
+    $this->patchJson("/api/v3/groups/{$team}/members/{$stranger}", ['role' => 'editor'], authHeader($users['owner']))
+        ->assertNotFound();
+});
+
+it('does not register PUT', function () {
+    [$team, $users] = makeTeam();
+    $reader = memberId($team, $users['reader']);
+
+    $this->putJson("/api/v3/groups/{$team}/members/{$reader}", ['role' => 'editor'], authHeader($users['owner']))
+        ->assertMethodNotAllowed();
+});
+
+/* ---------------- DELETE members ---------------- */
+
+it('lets managers remove members', function () {
+    [$team, $users] = makeTeam();
+    $editor = GroupMember::where('group_id', $team)->where('user_id', $users['editor'])->first();
+
+    $this->deleteJson("/api/v3/groups/{$team}/members/{$editor->id}", [], authHeader($users['manager']))
+        ->assertNoContent();
+
+    $this->assertModelMissing($editor);
+});
+
+it('lets a reader leave the team', function () {
+    [$team, $users] = makeTeam();
+    $reader = GroupMember::where('group_id', $team)->where('user_id', $users['reader'])->first();
+
+    $this->deleteJson("/api/v3/groups/{$team}/members/{$reader->id}", [], authHeader($users['reader']))
+        ->assertNoContent();
+
+    $this->assertModelMissing($reader);
+});
+
+it('does not let a reader remove someone else', function () {
+    [$team, $users] = makeTeam();
+    $editor = memberId($team, $users['editor']);
+
+    $this->deleteJson("/api/v3/groups/{$team}/members/{$editor}", [], authHeader($users['reader']))
+        ->assertForbidden();
+});
+
+it('never removes the owner, not even by themselves', function (string $actor) {
+    [$team, $users] = makeTeam();
+    $owner = memberId($team, $users['owner']);
+
+    $this->deleteJson("/api/v3/groups/{$team}/members/{$owner}", [], authHeader($users[$actor]))
+        ->assertForbidden();
+
+    expect(GroupMember::find($owner))->not->toBeNull();
+})->with(['owner', 'manager']);

+ 122 - 0
api-v13/tests/Feature/GroupShareV3Test.php

@@ -0,0 +1,122 @@
+<?php
+
+use App\Models\Share;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Str;
+
+uses(RefreshDatabase::class);
+
+/**
+ * v3 团队文档:共享给团队的资源。
+ *
+ * 端点:
+ *   GET    /api/v3/groups/{group}/shares           列表(成员)
+ *   DELETE /api/v3/groups/{group}/shares/{share}   移出团队(团队 owner / manager,或资源拥有者)
+ *
+ * 这里断言的是形状而非契约(spectator 未安装,见 v3-resource skill 第 3 步)。
+ */
+function shareToTeam(string $team, string $resId, int $resType = 2, int $power = 20): Share
+{
+    $share = new Share;
+    $share->forceFill([
+        'id' => random_int(1, PHP_INT_MAX),
+        'res_id' => $resId,
+        'res_type' => $resType,
+        'cooperator_id' => $team,
+        'cooperator_type' => 1,
+        'power' => $power,
+        'create_time' => time() * 1000,
+        'modify_time' => time() * 1000,
+    ])->save();
+
+    return $share;
+}
+
+it('lists what is shared with the team', function () {
+    [$team, $users] = makeTeam();
+    $author = makeStudio('author');
+    $channel = makeChannel($author, 'shared channel');
+    shareToTeam($team, $channel, 2, 20);
+    shareToTeam($team, (string) Str::uuid(), 3, 10); // 资源已被删掉的文章
+
+    $data = $this->getJson("/api/v3/groups/{$team}/shares", authHeader($users['reader']))
+        ->assertOk()
+        ->assertJsonPath('meta.total', 2)
+        ->json('data');
+
+    $byType = collect($data)->keyBy('resource.type');
+    expect($byType['channel'])->toMatchArray(['role' => 'editor']);
+    expect($byType['channel']['resource'])->toMatchArray([
+        'type' => 'channel', 'id' => $channel, 'title' => 'shared channel', 'owner_id' => $author,
+    ]);
+    expect($byType['channel']['resource']['owner']['id'])->toBe($author);
+    expect($byType['article']['resource']['owner'])->toBeNull();
+    expect($byType['article']['role'])->toBe('reader');
+    expect($byType['article']['resource']['title'])->toBeNull();
+    expect($byType['article']['id'])->toBeString();
+});
+
+it('hides the team documents from outsiders', function () {
+    [$team, $users] = makeTeam();
+
+    $this->getJson("/api/v3/groups/{$team}/shares", authHeader($users['outsider']))->assertForbidden();
+    $this->getJson("/api/v3/groups/{$team}/shares")->assertUnauthorized();
+});
+
+it('does not query per share', function () {
+    [$team, $users] = makeTeam();
+    $countQueriesFor = function (int $extra) use ($team, $users): int {
+        for ($i = 0; $i < $extra; $i++) {
+            shareToTeam($team, makeChannel(makeStudio('a-'.Str::random(8))));
+        }
+        DB::flushQueryLog();
+        DB::enableQueryLog();
+        $this->getJson("/api/v3/groups/{$team}/shares", authHeader($users['reader']))->assertOk();
+        $count = count(DB::getQueryLog());
+        DB::disableQueryLog();
+
+        return $count;
+    };
+
+    expect($countQueriesFor(6))->toBe($countQueriesFor(1));
+});
+
+it('lets team managers remove a share', function (string $actor) {
+    [$team, $users] = makeTeam();
+    $share = shareToTeam($team, makeChannel(makeStudio('author')));
+
+    $this->deleteJson("/api/v3/groups/{$team}/shares/{$share->id}", [], authHeader($users[$actor]))
+        ->assertNoContent();
+
+    $this->assertModelMissing($share);
+})->with(['owner', 'manager']);
+
+it('lets the resource owner take it back even without managing the team', function () {
+    [$team, $users] = makeTeam();
+    $share = shareToTeam($team, makeChannel($users['reader']));
+
+    $this->deleteJson("/api/v3/groups/{$team}/shares/{$share->id}", [], authHeader($users['reader']))
+        ->assertNoContent();
+
+    $this->assertModelMissing($share);
+});
+
+it('does not let editors remove someone else\'s share', function () {
+    [$team, $users] = makeTeam();
+    $share = shareToTeam($team, makeChannel(makeStudio('author')));
+
+    $this->deleteJson("/api/v3/groups/{$team}/shares/{$share->id}", [], authHeader($users['editor']))
+        ->assertForbidden();
+
+    expect(Share::find($share->id))->not->toBeNull();
+});
+
+it('returns 404 for a share of another team', function () {
+    [$team, $users] = makeTeam();
+    [$otherTeam] = makeTeam();
+    $share = shareToTeam($otherTeam, makeChannel(makeStudio('author')));
+
+    $this->deleteJson("/api/v3/groups/{$team}/shares/{$share->id}", [], authHeader($users['owner']))
+        ->assertNotFound();
+});

+ 268 - 0
api-v13/tests/Feature/GroupV3Test.php

@@ -0,0 +1,268 @@
+<?php
+
+use App\Models\GroupInfo;
+use App\Models\GroupMember;
+use App\Models\Share;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Str;
+
+uses(RefreshDatabase::class);
+
+/**
+ * v3 团队本身。
+ *
+ * 端点:
+ *   GET    /api/v3/groups?search=        搜公开团队(登录)
+ *   POST   /api/v3/groups                建团队(登录,建的人成为 owner)
+ *   GET    /api/v3/groups/{group}        详情(公开团队可不登录;私有团队只有成员)
+ *   PATCH  /api/v3/groups/{group}        改信息(owner / manager)
+ *   DELETE /api/v3/groups/{group}        删团队(owner;名下有资源 409)
+ *   GET    /api/v3/me/groups?owned=&search=   我创建的 / 我参加的
+ *
+ * 这里断言的是形状而非契约(spectator 未安装,见 v3-resource skill 第 3 步)。
+ */
+function makePrivateTeam(): array
+{
+    [$team, $users] = makeTeam();
+    GroupInfo::where('uid', $team)->update(['status' => GroupInfo::STATUS_PRIVATE]);
+
+    return [$team, $users];
+}
+
+/* ---------------- 搜公开团队 ---------------- */
+
+it('searches public teams only', function () {
+    $me = makeStudio('me');
+    $public = makeGroup(makeStudio('a'), 'pali readers');
+    $private = makeGroup(makeStudio('b'), 'pali secret');
+    GroupInfo::where('uid', $private)->update(['status' => GroupInfo::STATUS_PRIVATE]);
+    makeGroup(makeStudio('c'), 'other');
+
+    $data = $this->getJson('/api/v3/groups?search=PALI', authHeader($me))
+        ->assertOk()
+        ->json('data');
+
+    expect(array_column($data, 'id'))->toBe([$public]);
+    expect($data[0])->toHaveKeys(['id', 'name', 'description', 'status', 'owner', 'created_at', 'updated_at']);
+    expect($data[0])->not->toHaveKey('role');
+});
+
+it('requires login to search teams', function () {
+    $this->getJson('/api/v3/groups')->assertUnauthorized();
+});
+
+it('does not query per team when searching', function () {
+    $me = makeStudio('me');
+    $countQueriesFor = function (int $teams) use ($me): int {
+        for ($i = 0; $i < $teams; $i++) {
+            makeGroup(makeStudio('owner-'.Str::random(8)), 'n+1 team '.Str::random(4));
+        }
+        DB::flushQueryLog();
+        DB::enableQueryLog();
+        $this->getJson('/api/v3/groups?search=n%2B1', authHeader($me))->assertOk();
+        $count = count(DB::getQueryLog());
+        DB::disableQueryLog();
+
+        return $count;
+    };
+
+    expect($countQueriesFor(8))->toBe($countQueriesFor(1));
+});
+
+/* ---------------- 建团队 ---------------- */
+
+it('creates a team with the creator as owner', function () {
+    $me = makeStudio('me');
+
+    $response = $this->postJson('/api/v3/groups', ['name' => '新团队', 'description' => '简介'], authHeader($me))
+        ->assertCreated()
+        ->assertJsonPath('data.name', '新团队')
+        ->assertJsonPath('data.status', GroupInfo::STATUS_PUBLIC)
+        ->assertJsonPath('data.role', 'owner')
+        ->assertJsonPath('data.owner.id', $me);
+
+    $team = $response->json('data.id');
+    $member = GroupMember::where('group_id', $team)->where('user_id', $me)->first();
+    expect($member->role)->toBe('owner');
+    expect((int) $member->power)->toBe(0);
+});
+
+it('rejects a duplicate name under the same owner', function () {
+    $me = makeStudio('me');
+    makeGroup($me, 'dup');
+
+    $this->postJson('/api/v3/groups', ['name' => 'dup'], authHeader($me))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors('name');
+
+    // 别人名下同名不冲突
+    $this->postJson('/api/v3/groups', ['name' => 'dup'], authHeader(makeStudio('other')))
+        ->assertCreated();
+});
+
+it('validates new teams', function (array $payload, string $field) {
+    $this->postJson('/api/v3/groups', $payload, authHeader(makeStudio('me')))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors($field);
+})->with([
+    'missing name' => [[], 'name'],
+    'name too long' => [['name' => str_repeat('a', 65)], 'name'],
+    'bad status' => [['name' => 'x', 'status' => 20], 'status'],
+]);
+
+it('requires login to create a team', function () {
+    $this->postJson('/api/v3/groups', ['name' => 'x'])->assertUnauthorized();
+});
+
+/* ---------------- 详情 ---------------- */
+
+it('shows a public team to anyone, with the viewer role', function () {
+    [$team, $users] = makeTeam();
+
+    $this->getJson("/api/v3/groups/{$team}")
+        ->assertOk()
+        ->assertJsonPath('data.id', $team)
+        ->assertJsonPath('data.role', null);
+
+    $this->getJson("/api/v3/groups/{$team}", authHeader($users['editor']))
+        ->assertJsonPath('data.role', 'editor');
+});
+
+it('hides a private team from outsiders', function () {
+    [$team, $users] = makePrivateTeam();
+
+    $this->getJson("/api/v3/groups/{$team}")->assertForbidden();
+    $this->getJson("/api/v3/groups/{$team}", authHeader($users['outsider']))->assertForbidden();
+    $this->getJson("/api/v3/groups/{$team}", authHeader($users['reader']))
+        ->assertOk()
+        ->assertJsonPath('data.role', 'reader');
+});
+
+it('returns 404 for an unknown team', function () {
+    $this->getJson('/api/v3/groups/'.Str::uuid())->assertNotFound();
+});
+
+/* ---------------- 改团队 ---------------- */
+
+it('lets owners and managers update the team', function (string $actor) {
+    [$team, $users] = makeTeam();
+
+    $this->patchJson("/api/v3/groups/{$team}", ['name' => 'renamed', 'status' => 10], authHeader($users[$actor]))
+        ->assertOk()
+        ->assertJsonPath('data.name', 'renamed')
+        ->assertJsonPath('data.status', 10)
+        ->assertJsonPath('data.role', $actor);
+
+    // 成员记录上冗余的团队名跟着改
+    expect(GroupMember::where('group_id', $team)->pluck('group_name')->unique()->all())->toBe(['renamed']);
+})->with(['owner', 'manager']);
+
+it('only changes the fields sent', function () {
+    [$team, $users] = makeTeam();
+    GroupInfo::where('uid', $team)->update(['description' => 'keep me']);
+
+    $this->patchJson("/api/v3/groups/{$team}", ['name' => 'renamed'], authHeader($users['owner']))
+        ->assertOk()
+        ->assertJsonPath('data.description', 'keep me');
+});
+
+it('does not let editors, readers or outsiders update the team', function (string $actor) {
+    [$team, $users] = makeTeam();
+
+    $this->patchJson("/api/v3/groups/{$team}", ['name' => 'hacked'], authHeader($users[$actor]))
+        ->assertForbidden();
+
+    expect(GroupInfo::find($team)->name)->toBe('test team');
+})->with(['editor', 'reader', 'outsider']);
+
+it('rejects renaming to a name the owner already uses', function () {
+    [$team, $users] = makeTeam();
+    makeGroup($users['owner'], 'taken');
+
+    $this->patchJson("/api/v3/groups/{$team}", ['name' => 'taken'], authHeader($users['manager']))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors('name');
+});
+
+it('does not register PUT on teams', function () {
+    [$team, $users] = makeTeam();
+
+    $this->putJson("/api/v3/groups/{$team}", ['name' => 'x'], authHeader($users['owner']))
+        ->assertMethodNotAllowed();
+});
+
+/* ---------------- 删团队 ---------------- */
+
+it('lets the owner delete a team with its members and shares', function () {
+    [$team, $users] = makeTeam();
+    $share = (new Share)->forceFill([
+        'id' => random_int(1, PHP_INT_MAX),
+        'res_id' => (string) Str::uuid(),
+        'res_type' => 2,
+        'cooperator_id' => $team,
+        'cooperator_type' => 1,
+        'power' => 20,
+        'create_time' => time() * 1000,
+        'modify_time' => time() * 1000,
+    ]);
+    $share->save();
+
+    $this->deleteJson("/api/v3/groups/{$team}", [], authHeader($users['owner']))
+        ->assertNoContent();
+
+    expect(GroupInfo::find($team))->toBeNull();
+    expect(GroupMember::where('group_id', $team)->exists())->toBeFalse();
+    $this->assertModelMissing($share);
+});
+
+it('refuses to delete a team that still owns resources', function () {
+    [$team, $users] = makeTeam();
+    makeChannel($team, 'team channel');
+
+    $this->deleteJson("/api/v3/groups/{$team}", [], authHeader($users['owner']))
+        ->assertConflict()
+        ->assertJsonPath('resources.channel', 1);
+
+    expect(GroupInfo::find($team))->not->toBeNull();
+});
+
+it('only lets the owner delete a team', function (string $actor) {
+    [$team, $users] = makeTeam();
+
+    $this->deleteJson("/api/v3/groups/{$team}", [], authHeader($users[$actor]))
+        ->assertForbidden();
+
+    expect(GroupInfo::find($team))->not->toBeNull();
+})->with(['manager', 'editor', 'outsider']);
+
+/* ---------------- 我的团队:owned / search ---------------- */
+
+it('filters my teams by ownership and name', function () {
+    $me = makeStudio('me');
+    $mine = makeGroup($me, 'mine alpha');
+    $joined = makeGroup(makeStudio('other'), 'joined beta');
+    addGroupMember($joined, $me);
+
+    $ids = fn (string $query) => array_column(
+        $this->getJson("/api/v3/me/groups{$query}", authHeader($me))->assertOk()->json('data'),
+        'id'
+    );
+
+    expect($ids(''))->toEqualCanonicalizing([$mine, $joined]);
+    expect($ids('?owned=true'))->toBe([$mine]);
+    expect($ids('?owned=false'))->toBe([$joined]);
+    expect($ids('?search=BETA'))->toBe([$joined]);
+
+    $row = $this->getJson('/api/v3/me/groups?owned=false', authHeader($me))->json('data.0');
+    expect($row['owner']['id'])->not->toBe($me);
+    expect($row)->toHaveKeys(['status', 'created_at', 'joined_at']);
+
+    $this->getJson('/api/v3/me/groups?owned=true', authHeader($me))->assertJsonPath('meta.total', 1);
+});
+
+it('rejects a bad owned filter', function () {
+    $this->getJson('/api/v3/me/groups?owned=maybe', authHeader(makeStudio('me')))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors('owned');
+});

+ 27 - 0
api-v13/tests/Pest.php

@@ -217,3 +217,30 @@ function addGroupMember(string $groupUid, string $userUid, int $power = 2, ?stri
 
 
     return $member;
     return $member;
 }
 }
+
+/**
+ * 建一个团队并按角色放好人,返回 [团队 uid, 角色 => 用户 uid]。
+ *
+ * owner 走 v2 口径(power 0、role 为空),manager 也是 v2 口径(power 1),
+ * editor / reader 是 v3 写入的(role 有值)——顺带覆盖 role 为空时按 power 推导。
+ *
+ * @return array{0: string, 1: array<string, string>}
+ */
+function makeTeam(): array
+{
+    $users = [];
+    foreach (['owner', 'manager', 'editor', 'reader', 'outsider'] as $role) {
+        $users[$role] = makeStudio($role.'-'.Str::random(6));
+    }
+    $team = makeGroup($users['owner']);
+    addGroupMember($team, $users['manager'], 1);
+    addGroupMember($team, $users['editor'], 2, 'editor');
+    addGroupMember($team, $users['reader'], 2, 'reader');
+
+    return [$team, $users];
+}
+
+function memberId(string $team, string $userUid): string
+{
+    return (string) GroupMember::where('group_id', $team)->where('user_id', $userUid)->value('id');
+}

+ 153 - 0
dashboard-test/src/tests/group-members.spec.ts

@@ -0,0 +1,153 @@
+import { test, expect, type Browser, type Page, type APIRequestContext } from '@playwright/test';
+import { authFile, call, type Account } from '../lib/api.js';
+import { collect } from '../lib/collect.js';
+import { BASE, HAS_STUDENT, USER, shotDir } from '../lib/env.js';
+
+/**
+ * 团队成员管理(/workspace/team/:teamId,v3 /v3/groups/{group}/members)。
+ *
+ * E2E_USER 是团队 owner;E2E_STUDENT_USER 充当被拉进团队的成员(没配就跳过相关用例)。
+ * 团队沿用 teamspace.spec 的「e2e 团队空间」,没有就建一个,跑完保留。
+ */
+const SHOT = shotDir('group-members');
+const TEAM = 'e2e 团队空间';
+
+interface Me {
+  id: string;
+  userName: string;
+  nickName: string;
+}
+
+const shot = (page: Page, name: string) =>
+  page.screenshot({ path: `${SHOT}/${name}.png`, fullPage: true });
+const memberRow = (page: Page, nick: string) =>
+  page.locator('.ant-pro-list-item').filter({ hasText: nick });
+const isMemberCall = (method: string) => (r: { url(): string; request(): { method(): string } }) =>
+  /\/api\/v3\/groups\/[^/]+\/members/.test(r.url()) && r.request().method() === method;
+
+async function me(request: APIRequestContext, who: Account): Promise<Me> {
+  const r = await call(request, 'GET', '/v3/me', undefined, who);
+  expect(r.status).toBe(200);
+  return r.body.data;
+}
+
+async function teamId(request: APIRequestContext): Promise<string> {
+  const find = async () => {
+    const r = await call(request, 'GET', '/v3/me/groups?per_page=200');
+    expect(r.status).toBe(200);
+    return (r.body.data as { id: string; name: string; role: string }[]).find(
+      (g) => g.name === TEAM && g.role === 'owner',
+    )?.id;
+  };
+  let id = await find();
+  if (!id) {
+    await call(request, 'POST', '/v2/group', { name: TEAM, studio_name: USER });
+    id = await find();
+  }
+  expect(id, '测试账号应当拥有测试团队').toBeTruthy();
+  return id!;
+}
+
+/** 把某人移出团队(存在才移),返回是否移过 */
+async function kick(request: APIRequestContext, team: string, userId: string) {
+  const r = await call(request, 'GET', `/v3/groups/${team}/members?per_page=200`);
+  const row = (r.body.data as { id: string; user?: { id: string } }[]).find((m) => m.user?.id === userId);
+  if (row) await call(request, 'DELETE', `/v3/groups/${team}/members/${row.id}`);
+}
+
+async function roleOf(request: APIRequestContext, team: string, userId: string) {
+  const r = await call(request, 'GET', `/v3/groups/${team}/members?per_page=200`);
+  return (r.body.data as { role: string; user?: { id: string } }[]).find((m) => m.user?.id === userId)?.role;
+}
+
+async function open(browser: Browser, who: Account) {
+  const ctx = await browser.newContext({ baseURL: BASE, storageState: authFile(who) });
+  return { ctx, page: await ctx.newPage() };
+}
+
+test.describe('团队成员管理', () => {
+  test.skip(!HAS_STUDENT, '需要第二个账号 E2E_STUDENT_USER 当成员');
+
+  test('owner 加人、改角色;成员看不到管理入口、能自己退出', async ({ page, request, browser }) => {
+    const log = collect(page);
+    const team = await teamId(request);
+    const student = await me(request, 'student');
+    await kick(request, team, student.id);
+
+    await test.step('1. 成员列表:owner 排第一,有「加人」', async () => {
+      await page.goto(`workspace/team/${team}`, { waitUntil: 'networkidle' });
+      await expect(page.locator('.ant-pro-list-item').first()).toContainText('拥有者');
+      await expect(page.getByRole('button', { name: /加人/ })).toBeVisible();
+      await shot(page, '01-list');
+    });
+
+    await test.step('2. 加人:默认只读成员', async () => {
+      await page.getByRole('button', { name: /加人/ }).click();
+      const pop = page.locator('.ant-popover:visible');
+      await pop.locator('.ant-select').first().click();
+      await pop.locator('.ant-select').first().locator('input').pressSequentially(student.userName, { delay: 30 });
+      await page
+        .locator('.ant-select-dropdown:not(.ant-select-dropdown-hidden) .ant-select-item-option')
+        .filter({ hasText: `${student.userName}-${student.nickName}` })
+        .first()
+        .click();
+      const added = page.waitForResponse(isMemberCall('POST'));
+      await pop.getByRole('button', { name: /提 *交/ }).click();
+      expect((await added).status()).toBe(201);
+
+      await expect(memberRow(page, student.nickName)).toContainText('只读成员');
+      expect(await roleOf(request, team, student.id)).toBe('reader');
+      await shot(page, '02-added');
+      log.dump('2. 加人');
+    });
+
+    await test.step('3. 改角色为编辑', async () => {
+      await memberRow(page, student.nickName).locator('.ant-select').click();
+      const patched = page.waitForResponse(isMemberCall('PATCH'));
+      await page
+        .locator('.ant-select-dropdown:not(.ant-select-dropdown-hidden) .ant-select-item-option')
+        .filter({ hasText: /^编辑$/ })
+        .click();
+      expect((await patched).status()).toBe(200);
+      await expect(memberRow(page, student.nickName)).toContainText('编辑');
+      expect(await roleOf(request, team, student.id)).toBe('editor');
+      await shot(page, '03-role');
+    });
+
+    await test.step('4. 成员视角:没有管理入口,能退出团队', async () => {
+      const { ctx, page: other } = await open(browser, 'student');
+      await other.goto(`workspace/team/${team}`, { waitUntil: 'networkidle' });
+      await expect(memberRow(other, student.nickName)).toContainText('编辑');
+      await expect(other.getByRole('button', { name: /加人/ })).toHaveCount(0);
+      await expect(memberRow(other, student.nickName).locator('.ant-select')).toHaveCount(0);
+
+      await other.getByRole('button', { name: '退出团队' }).click();
+      const left = other.waitForResponse(isMemberCall('DELETE'));
+      await other.locator('.ant-popconfirm:visible').getByRole('button', { name: /确 *定/ }).click();
+      expect((await left).status()).toBe(204);
+      await expect(other).toHaveURL(/workspace\/team$/);
+      await shot(other, '04-left');
+      await ctx.close();
+
+      expect(await roleOf(request, team, student.id)).toBeUndefined();
+    });
+  });
+
+  test('owner 移除成员', async ({ page, request }) => {
+    const team = await teamId(request);
+    const student = await me(request, 'student');
+    await kick(request, team, student.id);
+    const r = await call(request, 'POST', `/v3/groups/${team}/members`, { user_id: student.id });
+    expect(r.status).toBe(201);
+
+    await page.goto(`workspace/team/${team}`, { waitUntil: 'networkidle' });
+    const row = memberRow(page, student.nickName);
+    await row.getByRole('button', { name: /移/ }).click();
+    const removed = page.waitForResponse(isMemberCall('DELETE'));
+    await page.locator('.ant-popconfirm:visible').getByRole('button', { name: /确 *定/ }).click();
+    expect((await removed).status()).toBe(204);
+    await expect(row).toHaveCount(0);
+    expect(await roleOf(request, team, student.id)).toBeUndefined();
+    await shot(page, '05-removed');
+  });
+});

+ 138 - 0
dashboard-test/src/tests/groups.spec.ts

@@ -0,0 +1,138 @@
+import { test, expect, type Page, type APIRequestContext } from '@playwright/test';
+import { call } from '../lib/api.js';
+import { collect } from '../lib/collect.js';
+import { DESTRUCTIVE, USER, shotDir } from '../lib/env.js';
+
+/**
+ * 团队页(/workspace/team,v3 /groups 与 /me/groups):建、改、删,
+ * 名下还有资源时拒删,团队文档里把资源移出团队。
+ *
+ * 临时团队叫 e2e-tmp-<时间戳>,用例末尾删掉。「名下有资源」用固定团队 HAS_CHANNEL:
+ * 团队名下的 channel 在 v2 里谁都删不掉(v2 只认 owner 本人),channel 迁 v3 之前无法清理,
+ * 所以只建一次、反复用。
+ */
+const HAS_CHANNEL = 'e2e 团队(名下有资源)';
+const SHOT = shotDir('groups');
+
+const shot = (page: Page, name: string) =>
+  page.screenshot({ path: `${SHOT}/${name}.png`, fullPage: true });
+const row = (page: Page, name: string) => page.locator('.ant-table-row').filter({ hasText: name });
+const isGroupCall = (method: string, tail = '') => (r: { url(): string; request(): { method(): string } }) =>
+  new RegExp(`/api/v3/groups(/[^/?]+)?${tail}(\\?|$)`).test(r.url()) && r.request().method() === method;
+
+async function createTeam(request: APIRequestContext, name: string): Promise<string> {
+  const r = await call(request, 'POST', '/v3/groups', { name });
+  expect(r.status, JSON.stringify(r.body)).toBe(201);
+  return r.body.data.id;
+}
+
+/** 测试账号名下的固定团队,没有就建;建好后经 v2 在它名下建一个 channel */
+async function teamWithChannel(request: APIRequestContext): Promise<string> {
+  const mine = await call(request, 'GET', '/v3/me/groups?owned=true&per_page=200');
+  const found = (mine.body.data as { id: string; name: string }[]).find((g) => g.name === HAS_CHANNEL);
+  if (found) return found.id;
+  const id = await createTeam(request, HAS_CHANNEL);
+  const ch = await call(request, 'POST', '/v2/channel', {
+    studio: id, name: `${HAS_CHANNEL}-channel`, type: 'translation', lang: 'zh-Hans',
+  });
+  expect(ch.body?.ok, JSON.stringify(ch.body)).toBe(true);
+  return id;
+}
+
+async function teamExists(request: APIRequestContext, id: string) {
+  return (await call(request, 'GET', `/v3/groups/${id}`)).status === 200;
+}
+
+test.describe('团队页', () => {
+  test.skip(!DESTRUCTIVE, 'E2E_DESTRUCTIVE=0');
+
+  test('建团队 → 改名与可见性 → 删除', async ({ page, request }) => {
+    const log = collect(page);
+    const name = `e2e-tmp-${Date.now()}`;
+    let id = '';
+
+    await test.step('1. 新建', async () => {
+      await page.goto('workspace/team', { waitUntil: 'networkidle' });
+      await page.getByRole('button', { name: /新建/ }).click();
+      const pop = page.locator('.ant-popover:visible');
+      await pop.getByRole('textbox', { name: /名称/ }).fill(name);
+      const created = page.waitForResponse(isGroupCall('POST'));
+      await pop.getByRole('button', { name: /提 *交/ }).click();
+      const res = await created;
+      expect(res.status()).toBe(201);
+      id = (await res.json()).data.id;
+
+      await expect(row(page, name)).toBeVisible();
+      await expect(row(page, name)).toContainText('拥有者');
+      await shot(page, '01-created');
+      log.dump('1. 新建');
+    });
+
+    await test.step('2. 设置页改名、改为私有', async () => {
+      await row(page, name).getByRole('button', { name: '设置' }).first().click();
+      await expect(page).toHaveURL(new RegExp(`workspace/team/${id}/setting$`));
+      await page.locator('input#name').fill(`${name}-renamed`);
+      await page.getByText('私有(只有成员看得到)').click();
+      const patched = page.waitForResponse(isGroupCall('PATCH'));
+      await page.getByRole('button', { name: /提 *交/ }).click();
+      expect((await patched).status()).toBe(200);
+
+      const r = await call(request, 'GET', `/v3/groups/${id}`);
+      expect(r.body.data).toMatchObject({ name: `${name}-renamed`, status: 10 });
+      await shot(page, '02-edited');
+    });
+
+    await test.step('3. 列表里删除', async () => {
+      await page.goto('workspace/team', { waitUntil: 'networkidle' });
+      const target = row(page, `${name}-renamed`);
+      await target.locator('.ant-dropdown-trigger').click();
+      await page.locator('.ant-dropdown:visible').getByText('删除').click();
+      const deleted = page.waitForResponse(isGroupCall('DELETE'));
+      await page.locator('.ant-modal-confirm').getByRole('button', { name: /删 *除/ }).click();
+      expect((await deleted).status()).toBe(204);
+      await expect(target).toHaveCount(0);
+      expect(await teamExists(request, id)).toBe(false);
+      await shot(page, '03-deleted');
+    });
+  });
+
+  test('名下还有 channel 时拒删,提示原因', async ({ page, request }) => {
+    const id = await teamWithChannel(request);
+
+    await page.goto('workspace/team', { waitUntil: 'networkidle' });
+    await row(page, HAS_CHANNEL).locator('.ant-dropdown-trigger').click();
+    await page.locator('.ant-dropdown:visible').getByText('删除').click();
+    const deleted = page.waitForResponse(isGroupCall('DELETE'));
+    await page.locator('.ant-modal-confirm').getByRole('button', { name: /删 *除/ }).click();
+    expect((await deleted).status()).toBe(409);
+    await expect(page.locator('.ant-message, .ant-notification')).toContainText('团队名下还有资源');
+    expect(await teamExists(request, id)).toBe(true);
+    await shot(page, '04-conflict');
+  });
+
+  test('团队文档:共享进来的资源可以移出团队', async ({ page, request }) => {
+    const name = `e2e-tmp-${Date.now()}`;
+    const id = await createTeam(request, name);
+    // 测试账号自己名下的第一个 channel(channel 还没迁 v3,经 v2 查),共享给临时团队
+    const mine = await call(request, 'GET', `/v2/channel?view=studio&name=${USER}&limit=1`);
+    const channel = mine.body?.data?.rows?.[0]?.uid;
+    expect(channel, '测试账号名下至少要有一个 channel').toBeTruthy();
+    const shared = await call(request, 'POST', '/v2/share', {
+      res_id: channel, res_type: 2, user_id: [id], user_type: 'group', role: 'editor',
+    });
+    expect(shared.body?.ok, JSON.stringify(shared.body)).toBe(true);
+
+    await page.goto(`workspace/team/${id}`, { waitUntil: 'networkidle' });
+    const item = page.locator('.ant-pro-list-item').filter({ hasText: '可编辑' });
+    await expect(item).toHaveCount(1);
+    await shot(page, '05-shared');
+
+    const removed = page.waitForResponse(isGroupCall('DELETE', '/shares/[^/?]+'));
+    await item.getByRole('button', { name: /移/ }).click();
+    await page.locator('.ant-popconfirm:visible').getByRole('button', { name: /确 *定/ }).click();
+    expect((await removed).status()).toBe(204);
+    await expect(item).toHaveCount(0);
+
+    expect((await call(request, 'DELETE', `/v3/groups/${id}`)).status).toBe(204);
+  });
+});

+ 77 - 11
dashboard-test/src/tests/teamspace.spec.ts

@@ -1,7 +1,8 @@
 import { test, expect, type Page } from '@playwright/test';
 import { test, expect, type Page } from '@playwright/test';
+import { type APIRequestContext } from '@playwright/test';
 import { call } from '../lib/api.js';
 import { call } from '../lib/api.js';
 import { collect } from '../lib/collect.js';
 import { collect } from '../lib/collect.js';
-import { USER, shotDir } from '../lib/env.js';
+import { shotDir } from '../lib/env.js';
 
 
 /**
 /**
  * 团队空间(P0):头像弹窗里切到团队空间、顶栏标签、菜单置灰、直接访问被拦、
  * 团队空间(P0):头像弹窗里切到团队空间、顶栏标签、菜单置灰、直接访问被拦、
@@ -12,23 +13,49 @@ import { USER, shotDir } from '../lib/env.js';
  */
  */
 const SHOT = shotDir('teamspace');
 const SHOT = shotDir('teamspace');
 const TEAM = 'e2e 团队空间';
 const TEAM = 'e2e 团队空间';
+const TEAM2 = 'e2e 团队空间 2';
 
 
 const shot = (page: Page, name: string) =>
 const shot = (page: Page, name: string) =>
   page.screenshot({ path: `${SHOT}/${name}.png`, fullPage: true });
   page.screenshot({ path: `${SHOT}/${name}.png`, fullPage: true });
 const badge = (page: Page) => page.getByTestId('teamspace-badge');
 const badge = (page: Page) => page.getByTestId('teamspace-badge');
 const menuItem = (page: Page, label: string) =>
 const menuItem = (page: Page, label: string) =>
   page.locator('.ant-layout-sider .ant-menu-item').filter({ hasText: label });
   page.locator('.ant-layout-sider .ant-menu-item').filter({ hasText: label });
+/** 展开主导航的「协作」子菜单(inline 子菜单收起时子项不渲染) */
+async function openCollaboration(page: Page) {
+  const title = page.locator('.ant-layout-sider .ant-menu-submenu').filter({ hasText: '协作' });
+  if (!(await title.getAttribute('class'))?.includes('ant-menu-submenu-open')) {
+    await title.locator('.ant-menu-submenu-title').click();
+  }
+}
 const stored = (page: Page) => page.evaluate(() => localStorage.getItem('teamspace'));
 const stored = (page: Page) => page.evaluate(() => localStorage.getItem('teamspace'));
 
 
+/** 测试账号名下的团队,没有就建(本地测试数据保留不删) */
+async function ensureTeam(request: APIRequestContext, name: string): Promise<string> {
+  const mine = await call(request, 'GET', '/v3/me/groups?owned=true&per_page=200');
+  const found = (mine.body.data as { id: string; name: string }[]).find((g) => g.name === name);
+  if (found) return found.id;
+  const created = await call(request, 'POST', '/v3/groups', { name });
+  expect(created.status, JSON.stringify(created.body)).toBe(201);
+  return created.body.data.id;
+}
+
+/** 头像弹窗里选一个团队空间 */
+async function switchTo(page: Page, name: string) {
+  await page.locator('.ant-layout-sider .ant-avatar').first().hover();
+  const popover = page.locator('.ant-popover:visible');
+  const title = popover.getByText('切换到团队空间');
+  if (!(await popover.getByText(name, { exact: true }).isVisible())) {
+    await title.click();
+  }
+  await popover.getByText(name, { exact: true }).click();
+}
+
 let teamId = '';
 let teamId = '';
+let team2Id = '';
 
 
 test.beforeAll(async ({ request }) => {
 test.beforeAll(async ({ request }) => {
-  // 测试账号名下建一个团队;已存在时后端回 ok:false,忽略即可(本地测试数据保留不删)
-  await call(request, 'POST', '/v2/group', { name: TEAM, studio_name: USER });
-  const { body } = await call(request, 'GET', '/v2/group-member?view=user');
-  const rows = (body?.data?.rows ?? []) as { group?: { id: string; name: string } }[];
-  teamId = rows.find((row) => row.group?.name === TEAM)?.group?.id ?? '';
-  expect(teamId, '测试账号应当是该团队的成员').not.toBe('');
+  teamId = await ensureTeam(request, TEAM);
+  team2Id = await ensureTeam(request, TEAM2);
 });
 });
 
 
 test.describe('团队空间切换', () => {
 test.describe('团队空间切换', () => {
@@ -41,10 +68,7 @@ test.describe('团队空间切换', () => {
       await page.reload({ waitUntil: 'networkidle' });
       await page.reload({ waitUntil: 'networkidle' });
       await expect(badge(page)).toHaveCount(0);
       await expect(badge(page)).toHaveCount(0);
 
 
-      await page.locator('.ant-layout-sider .ant-avatar').first().hover();
-      const popover = page.locator('.ant-popover:visible');
-      await popover.getByText('切换到团队空间').click();
-      await popover.getByText(TEAM, { exact: true }).click();
+      await switchTo(page, TEAM);
 
 
       await expect(badge(page)).toContainText(TEAM);
       await expect(badge(page)).toContainText(TEAM);
       expect(JSON.parse((await stored(page)) ?? '{}').id).toBe(teamId);
       expect(JSON.parse((await stored(page)) ?? '{}').id).toBe(teamId);
@@ -57,9 +81,42 @@ test.describe('团队空间切换', () => {
       await expect(menuItem(page, '术语')).toHaveClass(/ant-menu-item-disabled/);
       await expect(menuItem(page, '术语')).toHaveClass(/ant-menu-item-disabled/);
       await expect(menuItem(page, '最近')).toHaveClass(/ant-menu-item-disabled/);
       await expect(menuItem(page, '最近')).toHaveClass(/ant-menu-item-disabled/);
       await expect(menuItem(page, '主页')).not.toHaveClass(/ant-menu-item-disabled/);
       await expect(menuItem(page, '主页')).not.toHaveClass(/ant-menu-item-disabled/);
+      // 我加入的团队列表属于个人身份;管理本团队走「成员管理」
+      await openCollaboration(page);
+      await expect(menuItem(page, '团队空间')).toHaveClass(/ant-menu-item-disabled/);
+      await expect(menuItem(page, '成员管理')).not.toHaveClass(/ant-menu-item-disabled/);
       await shot(page, '02-menu');
       await shot(page, '02-menu');
     });
     });
 
 
+    await test.step('2b. 成员管理:列出当前团队的成员', async () => {
+      await menuItem(page, '成员管理').click();
+      await expect(page).toHaveURL(/workspace\/members$/);
+      await expect(page.locator('.ant-pro-list-item').first()).toContainText('拥有者');
+      await page.goto('workspace/team', { waitUntil: 'networkidle' });
+      await expect(page.getByTestId('teamspace-blocked')).toContainText('个人专属功能');
+      await shot(page, '02b-members');
+    });
+
+    await test.step('2c. 在成员管理页切换团队空间,成员列表跟着换', async () => {
+      await page.goto('workspace/members', { waitUntil: 'networkidle' });
+      await expect(badge(page)).toContainText(TEAM);
+
+      const refetched = page.waitForResponse(
+        (r) => r.url().includes(`/api/v3/groups/${team2Id}/members`) && r.request().method() === 'GET',
+      );
+      await switchTo(page, TEAM2);
+      expect((await refetched).status()).toBe(200);
+      await expect(badge(page)).toContainText(TEAM2);
+      await expect(page).toHaveURL(/workspace\/members$/);
+      await shot(page, '02c-switched-members');
+
+      // 切回第一个团队,后面的步骤以它为准
+      const back = page.waitForResponse((r) => r.url().includes(`/api/v3/groups/${teamId}/members`));
+      await switchTo(page, TEAM);
+      await back;
+      await expect(badge(page)).toContainText(TEAM);
+    });
+
     await test.step('3. 直接输入地址也进不去', async () => {
     await test.step('3. 直接输入地址也进不去', async () => {
       await page.goto('workspace/channel', { waitUntil: 'networkidle' });
       await page.goto('workspace/channel', { waitUntil: 'networkidle' });
       await expect(page.getByTestId('teamspace-blocked')).toContainText('该模块暂不支持团队空间');
       await expect(page.getByTestId('teamspace-blocked')).toContainText('该模块暂不支持团队空间');
@@ -82,6 +139,15 @@ test.describe('团队空间切换', () => {
       log.dump('5. 切回个人空间');
       log.dump('5. 切回个人空间');
     });
     });
 
 
+    await test.step('5b. 个人空间:成员管理置灰,直接访问被拦', async () => {
+      await openCollaboration(page);
+      await expect(menuItem(page, '成员管理')).toHaveClass(/ant-menu-item-disabled/);
+      await expect(menuItem(page, '团队空间')).not.toHaveClass(/ant-menu-item-disabled/);
+      await page.goto('workspace/members', { waitUntil: 'networkidle' });
+      await expect(page.getByTestId('teamspace-blocked')).toContainText('仅在团队空间中可用');
+      await expect(page.getByTestId('teamspace-blocked').getByRole('button')).toHaveCount(0);
+    });
+
     await test.step('6. 顶栏标签关掉也能切回个人空间', async () => {
     await test.step('6. 顶栏标签关掉也能切回个人空间', async () => {
       await page.evaluate(
       await page.evaluate(
         ([id, name]) =>
         ([id, name]) =>

+ 4 - 0
dashboard-v6/src/api/Auth.ts

@@ -5,6 +5,10 @@ export interface IStudio {
   realName?: string;
   realName?: string;
   avatar?: string;
   avatar?: string;
   roles?: string[];
   roles?: string[];
+  /** 团队空间:我在这个团队里的角色(owner / manager / editor / reader) */
+  role?: string;
+  /** 团队空间:我自己那条成员记录的 id,退出团队时用 */
+  memberId?: string;
 }
 }
 
 
 export interface IUser {
 export interface IUser {

+ 101 - 0
dashboard-v6/src/api/group-member.ts

@@ -0,0 +1,101 @@
+/**
+ * 团队成员(v3):我加入的团队、成员列表、加人、改角色、移人 / 退出。
+ *
+ * 取代 v2 的 `group-member`(`view=user` / `view=group`、POST、DELETE)。
+ * 团队本身的建、改、删、搜索与团队文档见 `group.ts`。
+ */
+import { api, unwrap, unwrapQuiet, unwrapVoid } from "./client";
+import type { paths } from "./schema";
+
+type MeGroupList =
+  paths["/v3/me/groups"]["get"]["responses"][200]["content"]["application/json"];
+type GroupMemberList =
+  paths["/v3/groups/{group}/members"]["get"]["responses"][200]["content"]["application/json"];
+
+/** 我加入的一个团队,带我在里面的角色 */
+export type MyGroup = NonNullable<MeGroupList["data"]>[number];
+export type GroupMember = NonNullable<GroupMemberList["data"]>[number];
+export type GroupMemberListMeta = GroupMemberList["meta"];
+
+/** 团队角色。owner 只在建团队时产生,不能分配 */
+export type GroupRole = "owner" | "manager" | "editor" | "reader";
+export type AssignableGroupRole = Exclude<GroupRole, "owner">;
+export const ASSIGNABLE_GROUP_ROLES: AssignableGroupRole[] = [
+  "manager",
+  "editor",
+  "reader",
+];
+
+/** 能加人、移人、改角色的角色 */
+export const canManageMembers = (role?: string): boolean =>
+  role === "owner" || role === "manager";
+
+/** 一个人加入的团队不会多,一页取全 */
+const MY_GROUPS_PAGE_SIZE = 200;
+
+/** 启动时后台取,失败不弹窗(调用方自己兜底) */
+export const fetchMyGroups = async (): Promise<MyGroup[]> =>
+  unwrapQuiet(
+    await api.GET("/v3/me/groups", {
+      params: { query: { per_page: MY_GROUPS_PAGE_SIZE } },
+    })
+  ).data ?? [];
+
+/** 「我的团队」分页列表:owned=true 我创建的、false 我参加的;数量读 meta.total */
+export const fetchMyGroupsPage = async (query: {
+  owned?: boolean;
+  search?: string;
+  page?: number;
+  per_page?: number;
+}) =>
+  unwrap(
+    await api.GET("/v3/me/groups", {
+      params: { query },
+    })
+  );
+
+export const fetchGroupMembers = async (
+  group: string,
+  page: number,
+  perPage: number
+) =>
+  unwrap(
+    await api.GET("/v3/groups/{group}/members", {
+      params: { path: { group }, query: { page, per_page: perPage } },
+    })
+  );
+
+export const addGroupMember = async (
+  group: string,
+  userId: string,
+  role?: AssignableGroupRole
+) =>
+  unwrap(
+    await api.POST("/v3/groups/{group}/members", {
+      params: { path: { group } },
+      body: { user_id: userId, role },
+    })
+  ).data;
+
+export const updateGroupMemberRole = async (
+  group: string,
+  member: string,
+  role: AssignableGroupRole
+) =>
+  unwrap(
+    await api.PATCH("/v3/groups/{group}/members/{member}", {
+      params: { path: { group, member } },
+      body: { role },
+    })
+  ).data;
+
+/** 移除成员;member 是自己那条就是退出团队 */
+export const removeGroupMember = async (
+  group: string,
+  member: string
+): Promise<void> =>
+  unwrapVoid(
+    await api.DELETE("/v3/groups/{group}/members/{member}", {
+      params: { path: { group, member } },
+    })
+  );

+ 85 - 85
dashboard-v6/src/api/group.ts

@@ -1,82 +1,36 @@
+/**
+ * 团队本身(v3)与团队文档(共享给团队的资源)。
+ *
+ * 取代 v2 的 `group`(增删改查、`view=all`)与 `share?view=group`。
+ * 「我的团队」与成员管理见 `group-member.ts`。
+ */
 import type { LoaderFunctionArgs } from "react-router";
 import type { LoaderFunctionArgs } from "react-router";
-import { get } from "../request";
-import type { IStudio, IUser, TRole } from "./Auth";
 
 
-export interface IGroup {
-  id: string;
-  name: string;
-}
+import { api, unwrap, unwrapQuiet, unwrapVoid } from "./client";
+import type { paths } from "./schema";
 
 
-export interface IGroupRequest {
-  id?: string;
-  name: string;
-  description?: string;
-  studio_name?: string;
-}
+type GroupSingle =
+  paths["/v3/groups/{group}"]["get"]["responses"][200]["content"]["application/json"];
+type GroupShareList =
+  paths["/v3/groups/{group}/shares"]["get"]["responses"][200]["content"]["application/json"];
 
 
-export interface IGroupDataRequest {
-  uid: string;
-  name: string;
-  description: string;
-  owner: string;
-  studio: IStudio;
-  role: TRole;
-  created_at: string;
-  updated_at: string;
-}
+export type Group = NonNullable<GroupSingle["data"]>;
+export type GroupShare = NonNullable<GroupShareList["data"]>[number];
 
 
-export interface IGroupResponse {
-  ok: boolean;
-  message: string;
-  data: IGroupDataRequest;
-}
-export interface IGroupListResponse {
-  ok: boolean;
-  message: string;
-  data: {
-    rows: IGroupDataRequest[];
-    count: number;
-  };
-}
-export interface IGroupMemberRequest {
-  id?: number;
-  user_id: string;
-  group_id: string;
-  power?: number;
-  level?: number;
-  status?: number;
-}
-export interface IGroupMemberData {
-  id?: number;
-  user_id: string;
-  group_id: string;
-  group: IStudio;
-  power?: number;
-  level?: number;
-  status?: number;
-  user: IUser;
-  created_at?: string;
-  updated_at?: string;
-}
-export interface IGroupMemberResponse {
-  ok: boolean;
-  message: string;
-  data: IGroupMemberData;
-}
-export interface IGroupMemberListResponse {
-  ok: boolean;
-  message: string;
-  data: {
-    rows: IGroupMemberData[];
-    role: TRole;
-    count: number;
-  };
-}
+/** 团队可见性:10 私有(只有成员看得到)、30 公开 */
+export const GROUP_STATUS_PRIVATE = 10;
+export const GROUP_STATUS_PUBLIC = 30;
 
 
-export interface IGroupMemberDeleteResponse {
-  ok: boolean;
-  message: string;
-  data: boolean;
+export type NewGroupInput =
+  paths["/v3/groups"]["post"]["requestBody"]["content"]["application/json"];
+export type GroupInput = NonNullable<
+  paths["/v3/groups/{group}"]["patch"]["requestBody"]
+>["content"]["application/json"];
+
+/** 别处(共享、课程等)仍在用的旧类型,与 v2 团队接口无关 */
+export interface IGroup {
+  id: string;
+  name: string;
 }
 }
 export interface IDeleteResponse {
 export interface IDeleteResponse {
   ok: boolean;
   ok: boolean;
@@ -84,22 +38,68 @@ export interface IDeleteResponse {
   data: number;
   data: number;
 }
 }
 
 
-export const fetchGroup = (groupId: string): Promise<IGroupResponse> => {
-  return get<IGroupResponse>(`/api/v2/group/${groupId}`);
-};
+export const fetchGroup = async (group: string): Promise<Group> =>
+  unwrap(await api.GET("/v3/groups/{group}", { params: { path: { group } } }))
+    .data as Group;
 
 
+/** 团队页路由的数据加载:给面包屑取团队名 */
 export async function groupLoader({ params }: LoaderFunctionArgs) {
 export async function groupLoader({ params }: LoaderFunctionArgs) {
-  const teamId = params.teamId;
-
-  if (!teamId) {
+  const group = params.teamId;
+  if (!group) {
     throw new Response("Missing teamId", { status: 400 });
     throw new Response("Missing teamId", { status: 400 });
   }
   }
-
-  const res = await fetchGroup(teamId);
-
-  if (!res.ok) {
+  try {
+    return unwrapQuiet(
+      await api.GET("/v3/groups/{group}", { params: { path: { group } } })
+    ).data;
+  } catch {
     throw new Response("team not found", { status: 404 });
     throw new Response("team not found", { status: 404 });
   }
   }
-
-  return res.data;
 }
 }
+
+/** 按名字搜公开团队(共享资源时挑团队) */
+export const searchGroups = async (search: string, perPage = 20) =>
+  unwrap(
+    await api.GET("/v3/groups", {
+      params: { query: { search, per_page: perPage } },
+    })
+  ).data ?? [];
+
+export const createGroup = async (body: NewGroupInput) =>
+  unwrap(await api.POST("/v3/groups", { body })).data;
+
+export const updateGroup = async (group: string, body: GroupInput) =>
+  unwrap(
+    await api.PATCH("/v3/groups/{group}", {
+      params: { path: { group } },
+      body,
+    })
+  ).data;
+
+/** 名下还有资源时后端 409,unwrapVoid 会弹出原因 */
+export const deleteGroup = async (group: string): Promise<void> =>
+  unwrapVoid(
+    await api.DELETE("/v3/groups/{group}", { params: { path: { group } } })
+  );
+
+export const fetchGroupShares = async (
+  group: string,
+  page: number,
+  perPage: number
+) =>
+  unwrap(
+    await api.GET("/v3/groups/{group}/shares", {
+      params: { path: { group }, query: { page, per_page: perPage } },
+    })
+  );
+
+/** 把资源移出团队(只删这条共享,资源本身不动) */
+export const removeGroupShare = async (
+  group: string,
+  share: string
+): Promise<void> =>
+  unwrapVoid(
+    await api.DELETE("/v3/groups/{group}/shares/{share}", {
+      params: { path: { group, share } },
+    })
+  );

+ 899 - 15
dashboard-v6/src/api/schema.d.ts

@@ -2982,13 +2982,17 @@ export interface paths {
         };
         };
         /**
         /**
          * 列出 group
          * 列出 group
-         * @description 实现:`GroupController@index`
+         * @deprecated
+         * @description `view=all` 已被 `GET /v3/groups?search=`(只搜公开团队)取代;
+         *     `view=studio`(含 `view2`)已被 `GET /v3/me/groups?owned=true|false` 取代。
+         *     保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         get: operations["get_api_v2_group"];
         get: operations["get_api_v2_group"];
         put?: never;
         put?: never;
         /**
         /**
          * 新建 group
          * 新建 group
-         * @description 实现:`GroupController@store`
+         * @deprecated
+         * @description 已被 `POST /v3/groups` 取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         post: operations["post_api_v2_group"];
         post: operations["post_api_v2_group"];
         delete?: never;
         delete?: never;
@@ -3006,13 +3010,17 @@ export interface paths {
         };
         };
         /**
         /**
          * 列出 group-member
          * 列出 group-member
-         * @description 实现:`GroupMemberController@index`
+         * @deprecated
+         * @description `view=user` 已被 `GET /v3/me/groups` 取代,`view=group` 已被 `GET /v3/groups/{group}/members` 取代。
+         *     保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         get: operations["get_api_v2_group_member"];
         get: operations["get_api_v2_group_member"];
         put?: never;
         put?: never;
         /**
         /**
-         * 新建 group-member
-         * @description 实现:`GroupMemberController@store`
+         * 往团队里加一名普通成员。
+         * @deprecated
+         * @description 已被 `POST /v3/groups/{group}/members` 取代(v3 可指定角色,默认 reader)。
+         *     2026-11-13 起要求调用者是该团队的 owner / manager。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         post: operations["post_api_v2_group_member"];
         post: operations["post_api_v2_group_member"];
         delete?: never;
         delete?: never;
@@ -3035,20 +3043,24 @@ export interface paths {
         get: operations["get_api_v2_group_member_group_member_"];
         get: operations["get_api_v2_group_member_group_member_"];
         /**
         /**
          * 更新 group-member/{group_member}
          * 更新 group-member/{group_member}
-         * @description 实现:`GroupMemberController@update`
+         * @deprecated
+         * @description 空实现。改成员角色请用 `PATCH /v3/groups/{group}/members/{member}`。
          */
          */
         put: operations["put_api_v2_group_member_group_member_"];
         put: operations["put_api_v2_group_member_group_member_"];
         post?: never;
         post?: never;
         /**
         /**
          * 删除 group-member/{group_member}
          * 删除 group-member/{group_member}
-         * @description 实现:`GroupMemberController@destroy`
+         * @deprecated
+         * @description 已被 `DELETE /v3/groups/{group}/members/{member}` 取代(v3 允许本人退出团队)。
+         *     保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         delete: operations["delete_api_v2_group_member_group_member_"];
         delete: operations["delete_api_v2_group_member_group_member_"];
         options?: never;
         options?: never;
         head?: never;
         head?: never;
         /**
         /**
          * 更新 group-member/{group_member}
          * 更新 group-member/{group_member}
-         * @description 实现:`GroupMemberController@update`
+         * @deprecated
+         * @description 空实现。改成员角色请用 `PATCH /v3/groups/{group}/members/{member}`。
          */
          */
         patch: operations["patch_api_v2_group_member_group_member_"];
         patch: operations["patch_api_v2_group_member_group_member_"];
         trace?: never;
         trace?: never;
@@ -3062,7 +3074,8 @@ export interface paths {
         };
         };
         /**
         /**
          * 获取我的,和协作channel数量
          * 获取我的,和协作channel数量
-         * @description 实现:`GroupController@showMyNumber`
+         * @deprecated
+         * @description 改读 `GET /v3/me/groups?owned=true|false` 的 `meta.total`。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         get: operations["get_api_v2_group_my_number"];
         get: operations["get_api_v2_group_my_number"];
         put?: never;
         put?: never;
@@ -3082,25 +3095,29 @@ export interface paths {
         };
         };
         /**
         /**
          * 获取单个 group/{group}
          * 获取单个 group/{group}
-         * @description 实现:`GroupController@show`
+         * @deprecated
+         * @description 已被 `GET /v3/groups/{group}` 取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         get: operations["get_api_v2_group_group_"];
         get: operations["get_api_v2_group_group_"];
         /**
         /**
          * 更新 group/{group}
          * 更新 group/{group}
-         * @description 实现:`GroupController@update`
+         * @deprecated
+         * @description 已被 `PATCH /v3/groups/{group}`(局部更新,owner / manager 可改)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         put: operations["put_api_v2_group_group_"];
         put: operations["put_api_v2_group_group_"];
         post?: never;
         post?: never;
         /**
         /**
          * 删除 group/{group}
          * 删除 group/{group}
-         * @description 实现:`GroupController@destroy`
+         * @deprecated
+         * @description 已被 `DELETE /v3/groups/{group}` 取代(名下还有资源时 409)。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         delete: operations["delete_api_v2_group_group_"];
         delete: operations["delete_api_v2_group_group_"];
         options?: never;
         options?: never;
         head?: never;
         head?: never;
         /**
         /**
          * 更新 group/{group}
          * 更新 group/{group}
-         * @description 实现:`GroupController@update`
+         * @deprecated
+         * @description 已被 `PATCH /v3/groups/{group}`(局部更新,owner / manager 可改)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
          */
         patch: operations["patch_api_v2_group_group_"];
         patch: operations["patch_api_v2_group_group_"];
         trace?: never;
         trace?: never;
@@ -8218,6 +8235,170 @@ export interface paths {
         patch?: never;
         patch?: never;
         trace?: never;
         trace?: never;
     };
     };
+    "/v3/groups": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        /**
+         * 搜公开团队
+         * @description 共享资源时挑团队用。只列公开团队(status 30),按名字排序。
+         *
+         *     实现:`V3\GroupController@index`
+         */
+        get: operations["get_api_v3_groups"];
+        put?: never;
+        /**
+         * 建团队
+         * @description 建的人成为 owner。同一个人名下不能重名。
+         *
+         *     实现:`V3\GroupController@store`
+         */
+        post: operations["post_api_v3_groups"];
+        delete?: never;
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
+    "/v3/groups/{group}": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        /**
+         * 团队详情
+         * @description 公开团队谁都能看(可不登录),私有团队只有成员能看。带查看者在团队里的角色。
+         *
+         *     实现:`V3\GroupController@show`
+         */
+        get: operations["get_api_v3_groups_group_"];
+        put?: never;
+        post?: never;
+        /**
+         * 删团队
+         * @description 只有 owner 能删。团队名下还有资源(channel、文章等)时拒绝,`resources` 里给出各类的条数;
+         *     否则连同成员与共享给团队的记录一起硬删,返回 204 空体。
+         *
+         *     实现:`V3\GroupController@destroy`
+         */
+        delete: operations["delete_api_v3_groups_group_"];
+        options?: never;
+        head?: never;
+        /**
+         * 改团队信息
+         * @description 团队的 owner / manager 才能调用,只改传了的字段。
+         *
+         *     实现:`V3\GroupController@update`
+         */
+        patch: operations["patch_api_v3_groups_group_"];
+        trace?: never;
+    };
+    "/v3/groups/{group}/members": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        /**
+         * 列出团队成员
+         * @description 只有团队成员看得到。owner、manager 在前,其余按加入时间排序。
+         *
+         *     实现:`V3\GroupMemberController@index`
+         */
+        get: operations["get_api_v3_groups_group_members"];
+        put?: never;
+        /**
+         * 加一名成员
+         * @description 团队的 owner / manager 才能调用。角色默认 reader(只读)。
+         *
+         *     实现:`V3\GroupMemberController@store`
+         */
+        post: operations["post_api_v3_groups_group_members"];
+        delete?: never;
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
+    "/v3/groups/{group}/members/{member}": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        get?: never;
+        put?: never;
+        post?: never;
+        /**
+         * 移除成员 / 退出团队
+         * @description 移除别人要 owner / manager;移除自己就是退出团队。owner 不能被移除、也不能退出。
+         *     硬删,成功返回 204 空体。
+         *
+         *     实现:`V3\GroupMemberController@destroy`
+         */
+        delete: operations["delete_api_v3_groups_group_members_member_"];
+        options?: never;
+        head?: never;
+        /**
+         * 改成员角色
+         * @description 团队的 owner / manager 才能调用;owner 那一行不能改。
+         *
+         *     实现:`V3\GroupMemberController@update`
+         */
+        patch: operations["patch_api_v3_groups_group_members_member_"];
+        trace?: never;
+    };
+    "/v3/groups/{group}/shares": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        /**
+         * 列出团队文档
+         * @description 只有团队成员看得到。每条带资源类型、标题与拥有者,以及团队对它的权限(reader / editor)。
+         *
+         *     实现:`V3\GroupShareController@index`
+         */
+        get: operations["get_api_v3_groups_group_shares"];
+        put?: never;
+        post?: never;
+        delete?: never;
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
+    "/v3/groups/{group}/shares/{share}": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        get?: never;
+        put?: never;
+        post?: never;
+        /**
+         * 把资源移出团队
+         * @description 团队的 owner / manager,或资源的拥有者才能调用。只删这条共享,资源本身不动。
+         *
+         *     实现:`V3\GroupShareController@destroy`
+         */
+        delete: operations["delete_api_v3_groups_group_shares_share_"];
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
     "/v3/heartbeat": {
     "/v3/heartbeat": {
         parameters: {
         parameters: {
             query?: never;
             query?: never;
@@ -8399,6 +8580,28 @@ export interface paths {
         patch?: never;
         patch?: never;
         trace?: never;
         trace?: never;
     };
     };
+    "/v3/me/groups": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        /**
+         * 列出我加入的团队
+         * @description 每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
+         *
+         *     实现:`V3\MeGroupController@__invoke`
+         */
+        get: operations["get_api_v3_me_groups"];
+        put?: never;
+        post?: never;
+        delete?: never;
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
     "/v3/me/reactions": {
     "/v3/me/reactions": {
         parameters: {
         parameters: {
             query?: never;
             query?: never;
@@ -19009,9 +19212,9 @@ export interface operations {
         requestBody: {
         requestBody: {
             content: {
             content: {
                 "application/json": {
                 "application/json": {
-                    /** @description 规则:required */
+                    /** @description 要加入的用户 uid */
                     user_id: string;
                     user_id: string;
-                    /** @description 规则:required */
+                    /** @description 团队 uid */
                     group_id: string;
                     group_id: string;
                 };
                 };
             };
             };
@@ -36921,6 +37124,634 @@ export interface operations {
             };
             };
         };
         };
     };
     };
+    get_api_v3_groups: {
+        parameters: {
+            query?: {
+                /** @description 每页数量,最大 200 */
+                per_page?: number;
+                /** @description 按团队名模糊匹配 */
+                search?: string;
+                /** @description 页码 */
+                page?: number;
+            };
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            status?: number;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            /** @description 仅在部分查询口径下返回。 */
+                            role?: string | null;
+                            created_at?: string;
+                            updated_at?: string;
+                        }[];
+                        meta?: components["schemas"]["PaginationMeta"];
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    post_api_v3_groups: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        requestBody: {
+            content: {
+                "application/json": {
+                    /** @description 团队名,最长 64 */
+                    name: string;
+                    /** @description 简介,最长 1024 */
+                    description?: string;
+                    /**
+                     * @description 10 私有、30 公开
+                     * @default 30
+                     */
+                    status?: number;
+                };
+            };
+        };
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            status?: number;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            /** @description 仅在部分查询口径下返回。 */
+                            role?: string | null;
+                            created_at?: string;
+                            updated_at?: string;
+                        };
+                    };
+                };
+            };
+            /** @description 建好了 */
+            201: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            status?: number;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            /** @description 仅在部分查询口径下返回。 */
+                            role?: string | null;
+                            created_at?: string;
+                            updated_at?: string;
+                        };
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    get_api_v3_groups_group_: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            status?: number;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            /** @description 仅在部分查询口径下返回。 */
+                            role?: string | null;
+                            created_at?: string;
+                            updated_at?: string;
+                        };
+                    };
+                };
+            };
+            /** @description 私有团队,且不是成员 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    delete_api_v3_groups_group_: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 已删除,无响应体 */
+            204: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content?: never;
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 只有 owner 能删 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            /** @description 团队名下还有资源 */
+            409: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    patch_api_v3_groups_group_: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: {
+            content: {
+                "application/json": {
+                    /** @description 团队名,最长 64 */
+                    name?: string;
+                    /** @description 简介,最长 1024 */
+                    description?: string;
+                    /** @description 10 私有、30 公开 */
+                    status?: number;
+                };
+            };
+        };
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            status?: number;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            /** @description 仅在部分查询口径下返回。 */
+                            role?: string | null;
+                            created_at?: string;
+                            updated_at?: string;
+                        };
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不能修改这个团队 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    get_api_v3_groups_group_members: {
+        parameters: {
+            query?: {
+                /** @description 每页数量,最大 200 */
+                per_page?: number;
+                /** @description 页码 */
+                page?: number;
+            };
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            group_id?: string;
+                            role?: string;
+                            joined_at?: string;
+                            user?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                        }[];
+                        meta?: components["schemas"]["PaginationMeta"];
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不是这个团队的成员 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    post_api_v3_groups_group_members: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+            };
+            cookie?: never;
+        };
+        requestBody: {
+            content: {
+                "application/json": {
+                    /** @description 要加入的用户 uuid */
+                    user_id: string;
+                    /**
+                     * @description 角色,默认 reader
+                     * @enum {string}
+                     */
+                    role?: "manager" | "editor" | "reader";
+                };
+            };
+        };
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            group_id?: string;
+                            role?: string;
+                            joined_at?: string;
+                            user?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                        };
+                    };
+                };
+            };
+            /** @description 加入成功 */
+            201: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            group_id?: string;
+                            role?: string;
+                            joined_at?: string;
+                            user?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                        };
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不能管理这个团队的成员 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    delete_api_v3_groups_group_members_member_: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+                /** @description 成员记录 id */
+                member: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 已移除,无响应体 */
+            204: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content?: never;
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不能移除这名成员 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    patch_api_v3_groups_group_members_member_: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+                /** @description 成员记录 id */
+                member: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: {
+            content: {
+                "application/json": {
+                    /**
+                     * @description 角色
+                     * @enum {string}
+                     */
+                    role?: "manager" | "editor" | "reader";
+                };
+            };
+        };
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            group_id?: string;
+                            role?: string;
+                            joined_at?: string;
+                            user?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                        };
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不能管理这个团队的成员,或目标是团队拥有者 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    get_api_v3_groups_group_shares: {
+        parameters: {
+            query?: {
+                /** @description 每页数量,最大 200 */
+                per_page?: number;
+                /** @description 页码 */
+                page?: number;
+            };
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            role?: string;
+                            resource?: {
+                                type?: string;
+                                id?: string;
+                                title?: string | null;
+                                owner_id?: string | null;
+                                owner?: {
+                                    id?: string;
+                                    nickName?: string;
+                                    userName?: string;
+                                    realName?: string;
+                                    sn?: number;
+                                    avatar?: string;
+                                    roles?: string[];
+                                } | null;
+                            };
+                            created_at?: string;
+                        }[];
+                        meta?: components["schemas"]["PaginationMeta"];
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不是这个团队的成员 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
+    delete_api_v3_groups_group_shares_share_: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+                /** @description 共享记录 id */
+                share: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 已移出,无响应体 */
+            204: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content?: never;
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不能移出这项资源 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
     get_api_v3_heartbeat: {
     get_api_v3_heartbeat: {
         parameters: {
         parameters: {
             query?: never;
             query?: never;
@@ -37392,6 +38223,59 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
             422: components["responses"]["ProblemValidation"];
         };
         };
     };
     };
+    get_api_v3_me_groups: {
+        parameters: {
+            query?: {
+                /** @description true 只列我创建的,false 只列我参加的别人的团队;不传列全部 */
+                owned?: boolean;
+                /** @description 每页数量,最大 200 */
+                per_page?: number;
+                /** @description 按团队名模糊匹配 */
+                search?: string;
+                /** @description 页码 */
+                page?: number;
+            };
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            owner_id?: string;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            status?: number;
+                            role?: string;
+                            member_id?: string;
+                            created_at?: string;
+                            joined_at?: string;
+                        }[];
+                        meta?: components["schemas"]["PaginationMeta"];
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
     get_api_v3_me_reactions: {
     get_api_v3_me_reactions: {
         parameters: {
         parameters: {
             query?: {
             query?: {

+ 24 - 23
dashboard-v6/src/components/group/AddMember.tsx

@@ -2,16 +2,18 @@ import { useIntl } from "react-intl";
 import { ProForm, ProFormSelect } from "@ant-design/pro-components";
 import { ProForm, ProFormSelect } from "@ant-design/pro-components";
 import { Button, message, Popover } from "antd";
 import { Button, message, Popover } from "antd";
 import { UserAddOutlined } from "@ant-design/icons";
 import { UserAddOutlined } from "@ant-design/icons";
-import { get, post } from "../../request";
+import { get } from "../../request";
 import type { IUserListResponse } from "../../api/Auth";
 import type { IUserListResponse } from "../../api/Auth";
-import type {
-  IGroupMemberRequest,
-  IGroupMemberResponse,
-} from "../../api/group";
+import {
+  ASSIGNABLE_GROUP_ROLES,
+  addGroupMember,
+  type AssignableGroupRole,
+} from "../../api/group-member";
 import { useState } from "react";
 import { useState } from "react";
 
 
 interface IFormData {
 interface IFormData {
   userId: string;
   userId: string;
+  role: AssignableGroupRole;
 }
 }
 
 
 interface IWidget {
 interface IWidget {
@@ -24,26 +26,16 @@ const AddMemberWidget = ({ groupId, onCreated }: IWidget) => {
 
 
   const form = (
   const form = (
     <ProForm<IFormData>
     <ProForm<IFormData>
+      initialValues={{ role: "reader" }}
       onFinish={async (values: IFormData) => {
       onFinish={async (values: IFormData) => {
-        console.log(values);
-        if (typeof groupId !== "undefined") {
-          post<IGroupMemberRequest, IGroupMemberResponse>(
-            "/api/v2/group-member",
-            {
-              user_id: values.userId,
-              group_id: groupId,
-            }
-          ).then((json) => {
-            console.log("add member", json);
-            if (json.ok) {
-              message.success(intl.formatMessage({ id: "flashes.success" }));
-              setOpen(false);
-              if (typeof onCreated !== "undefined") {
-                onCreated();
-              }
-            }
-          });
+        if (typeof groupId === "undefined") {
+          return;
         }
         }
+        // 失败(不是管理者、已是成员等)由 unwrap 统一弹提示
+        await addGroupMember(groupId, values.userId, values.role);
+        message.success(intl.formatMessage({ id: "flashes.success" }));
+        setOpen(false);
+        onCreated?.();
       }}
       }}
     >
     >
       <ProForm.Group>
       <ProForm.Group>
@@ -75,6 +67,15 @@ const AddMemberWidget = ({ groupId, onCreated }: IWidget) => {
             },
             },
           ]}
           ]}
         />
         />
+        <ProFormSelect
+          name="role"
+          label={intl.formatMessage({ id: "labels.group.role" })}
+          allowClear={false}
+          options={ASSIGNABLE_GROUP_ROLES.map((role) => ({
+            value: role,
+            label: intl.formatMessage({ id: `labels.group.role.${role}` }),
+          }))}
+        />
       </ProForm.Group>
       </ProForm.Group>
     </ProForm>
     </ProForm>
   );
   );

+ 8 - 22
dashboard-v6/src/components/group/GroupCreate.tsx

@@ -5,8 +5,7 @@ import {
   ProFormText,
   ProFormText,
 } from "@ant-design/pro-components";
 } from "@ant-design/pro-components";
 import { message } from "antd";
 import { message } from "antd";
-import { post } from "../../request";
-import type { IGroupRequest, IGroupResponse } from "../../api/group";
+import { createGroup } from "../../api/group";
 import { useRef } from "react";
 import { useRef } from "react";
 
 
 interface IFormData {
 interface IFormData {
@@ -14,10 +13,10 @@ interface IFormData {
 }
 }
 
 
 interface IWidgetGroupCreate {
 interface IWidgetGroupCreate {
-  studio?: string;
   onCreate?: () => void;
   onCreate?: () => void;
 }
 }
-const GroupCreateWidget = ({ studio, onCreate }: IWidgetGroupCreate) => {
+/** 建团队:建的人成为 owner(v3 由登录态决定,不再传 studio) */
+const GroupCreateWidget = ({ onCreate }: IWidgetGroupCreate) => {
   const intl = useIntl();
   const intl = useIntl();
   const formRef = useRef<ProFormInstance | undefined>(undefined);
   const formRef = useRef<ProFormInstance | undefined>(undefined);
 
 
@@ -25,24 +24,11 @@ const GroupCreateWidget = ({ studio, onCreate }: IWidgetGroupCreate) => {
     <ProForm<IFormData>
     <ProForm<IFormData>
       formRef={formRef}
       formRef={formRef}
       onFinish={async (values: IFormData) => {
       onFinish={async (values: IFormData) => {
-        if (typeof studio === "undefined") {
-          return;
-        }
-        console.log(values);
-        const res = await post<IGroupRequest, IGroupResponse>(`/api/v2/group`, {
-          name: values.name,
-          studio_name: studio,
-        });
-        console.log(res);
-        if (res.ok) {
-          message.success(intl.formatMessage({ id: "flashes.success" }));
-          if (typeof onCreate !== "undefined") {
-            onCreate();
-            formRef.current?.resetFields();
-          }
-        } else {
-          message.error(res.message);
-        }
+        // 失败(重名等)由 unwrap 统一弹提示
+        await createGroup({ name: values.name });
+        message.success(intl.formatMessage({ id: "flashes.success" }));
+        formRef.current?.resetFields();
+        onCreate?.();
       }}
       }}
     >
     >
       <ProForm.Group>
       <ProForm.Group>

+ 72 - 105
dashboard-v6/src/components/group/GroupFile.tsx

@@ -2,157 +2,124 @@ import { useIntl } from "react-intl";
 import { useRef, useState } from "react";
 import { useRef, useState } from "react";
 import { type ActionType, ProList } from "@ant-design/pro-components";
 import { type ActionType, ProList } from "@ant-design/pro-components";
 import { Space, Tag, Button, Layout, Popconfirm } from "antd";
 import { Space, Tag, Button, Layout, Popconfirm } from "antd";
-import { delete_, get } from "../../request";
-import type { IShareListResponse } from "../../api/Share";
-import type { IDeleteResponse } from "../../api/group";
+
+import {
+  fetchGroupShares,
+  removeGroupShare,
+  type GroupShare,
+} from "../../api/group";
+import { canManageMembers } from "../../api/group-member";
+import { useAppSelector } from "../../hooks";
+import { currentUser, studioList } from "../../reducers/current-user";
 
 
 const { Content } = Layout;
 const { Content } = Layout;
 
 
-interface IRoleTag {
-  title: string;
-  color: string;
-}
-interface DataItem {
-  id?: string;
-  name?: string;
-  tag: IRoleTag[];
-  image: string;
-  description?: string;
-}
+/** 资源类型 → 界面上的名字(沿用各模块的栏目名) */
+const TYPE_LABEL: Record<string, string> = {
+  channel: "columns.studio.channel.title",
+  article: "columns.studio.article.title",
+  collection: "columns.studio.anthology.title",
+};
+
 interface IWidget {
 interface IWidget {
   groupId?: string;
   groupId?: string;
 }
 }
+/**
+ * 团队文档:共享给这个团队的资源(v3 /groups/{group}/shares)。
+ * 团队的 owner / manager,或资源的拥有者,可以把资源移出团队。
+ */
 const GroupFileWidget = ({ groupId }: IWidget) => {
 const GroupFileWidget = ({ groupId }: IWidget) => {
   const intl = useIntl(); //i18n
   const intl = useIntl(); //i18n
-  const [canDelete, setCanDelete] = useState(false);
   const [resCount, setResCount] = useState(0);
   const [resCount, setResCount] = useState(0);
+  const user = useAppSelector(currentUser);
+  const studios = useAppSelector(studioList);
+  // 管理成员与管理团队文档是同一组角色(owner / manager)
+  const canManage = canManageMembers(
+    studios?.find((item) => item.id === groupId)?.role
+  );
+
   const ref = useRef<ActionType | null>(null);
   const ref = useRef<ActionType | null>(null);
   return (
   return (
     <Content>
     <Content>
-      <ProList<DataItem>
+      <ProList<GroupShare>
         rowKey="id"
         rowKey="id"
         actionRef={ref}
         actionRef={ref}
+        // groupId 放进 params:切换团队(团队空间或团队详情页)时 ProList 才会重新请求
+        params={{ groupId }}
         headerTitle={
         headerTitle={
           intl.formatMessage({ id: "group.files" }) + "-" + resCount.toString()
           intl.formatMessage({ id: "group.files" }) + "-" + resCount.toString()
         }
         }
         metas={{
         metas={{
           title: {
           title: {
-            dataIndex: "name",
-          },
-          avatar: {
-            dataIndex: "image",
-            editable: false,
+            render: (_dom, row) =>
+              row.resource?.title ??
+              intl.formatMessage({ id: "labels.group.share.missing" }),
           },
           },
           description: {
           description: {
-            dataIndex: "description",
-          },
-          content: {
-            dataIndex: "content",
-            editable: false,
+            render: (_dom, row) => row.resource?.owner?.nickName,
           },
           },
           subTitle: {
           subTitle: {
-            render: (_text, row, index) => {
-              const showtag = row.tag.map((item, id) => {
-                return (
-                  <Tag color={item.color} key={id}>
-                    {item.title}
-                  </Tag>
-                );
-              });
+            render: (_dom, row) => {
+              const type = row.resource?.type ?? "";
               return (
               return (
-                <Space size={0} key={index}>
-                  {showtag}
+                <Space size={0}>
+                  <Tag>
+                    {TYPE_LABEL[type]
+                      ? intl.formatMessage({ id: TYPE_LABEL[type] })
+                      : type}
+                  </Tag>
+                  <Tag color={row.role === "editor" ? "blue" : "default"}>
+                    {intl.formatMessage({
+                      id: `labels.group.share.${row.role ?? "reader"}`,
+                    })}
+                  </Tag>
                 </Space>
                 </Space>
               );
               );
             },
             },
           },
           },
           actions: {
           actions: {
-            render: (_text, row, index) => [
-              canDelete ? (
+            render: (_dom, row) =>
+              canManage ||
+              (user?.id && row.resource?.owner_id === user.id) ? (
                 <Popconfirm
                 <Popconfirm
-                  key={index}
                   title={intl.formatMessage({
                   title={intl.formatMessage({
                     id: "forms.message.res.remove",
                     id: "forms.message.res.remove",
                   })}
                   })}
                   onConfirm={() => {
                   onConfirm={() => {
-                    console.log("delete", row.id);
-                    delete_<IDeleteResponse>("/api/v2/share/" + row.id).then(
-                      (json) => {
-                        if (json.ok) {
-                          console.log("delete ok");
-                          ref.current?.reload();
-                        }
-                      }
-                    );
+                    if (groupId && row.id) {
+                      removeGroupShare(groupId, row.id).then(() =>
+                        ref.current?.reload()
+                      );
+                    }
                   }}
                   }}
                   okText={intl.formatMessage({ id: "buttons.ok" })}
                   okText={intl.formatMessage({ id: "buttons.ok" })}
                   cancelText={intl.formatMessage({ id: "buttons.cancel" })}
                   cancelText={intl.formatMessage({ id: "buttons.cancel" })}
                 >
                 >
-                  <Button size="small" type="link" danger key="link">
+                  <Button size="small" type="link" danger>
                     {intl.formatMessage({ id: "buttons.remove" })}
                     {intl.formatMessage({ id: "buttons.remove" })}
                   </Button>
                   </Button>
                 </Popconfirm>
                 </Popconfirm>
-              ) : (
-                <></>
-              ),
-            ],
+              ) : null,
           },
           },
         }}
         }}
-        request={async (params = {}, sorter, filter) => {
-          console.log(params, sorter, filter);
-
-          let url = `/api/v2/share?view=group&id=${groupId}`;
-          const offset =
-            ((params.current ? params.current : 1) - 1) *
-            (params.pageSize ? params.pageSize : 20);
-          url += `&limit=${params.pageSize}&offset=${offset}`;
-          if (typeof params.keyword !== "undefined") {
-            url += "&search=" + (params.keyword ? params.keyword : "");
+        request={async (params = {}) => {
+          if (!groupId) {
+            return { total: 0, success: false, data: [] };
           }
           }
-          const res = await get<IShareListResponse>(url);
-          if (res.ok) {
-            console.log(res.data.rows);
-            setResCount(res.data.count);
-            switch (res.data.role) {
-              case "owner":
-                setCanDelete(true);
-                break;
-              case "manager":
-                setCanDelete(true);
-                break;
-            }
-            const items: DataItem[] = res.data.rows.map((item) => {
-              const member: DataItem = {
-                id: item.id,
-                name: item.res_name,
-                tag: [],
-                image: "",
-                description: item.owner?.nickName,
-              };
-              switch (item.power) {
-                case 0:
-                  member.tag.push({ title: "拥有者", color: "success" });
-                  break;
-                case 1:
-                  member.tag.push({ title: "管理员", color: "default" });
-                  break;
-              }
-
-              return member;
-            });
-            console.log(items);
-            return {
-              total: res.data.count,
-              succcess: true,
-              data: items,
-            };
-          } else {
-            console.error(res.message);
+          try {
+            const res = await fetchGroupShares(
+              groupId,
+              params.current ?? 1,
+              params.pageSize ?? 20
+            );
+            setResCount(res.meta?.total ?? 0);
             return {
             return {
-              total: 0,
-              succcess: false,
-              data: [],
+              total: res.meta?.total ?? 0,
+              success: true,
+              data: res.data ?? [],
             };
             };
+          } catch {
+            return { total: 0, success: false, data: [] };
           }
           }
         }}
         }}
         pagination={{
         pagination={{

+ 98 - 133
dashboard-v6/src/components/group/GroupMember.tsx

@@ -1,118 +1,85 @@
 import { useIntl } from "react-intl";
 import { useIntl } from "react-intl";
 import { useRef, useState } from "react";
 import { useRef, useState } from "react";
 import { type ActionType, ProList } from "@ant-design/pro-components";
 import { type ActionType, ProList } from "@ant-design/pro-components";
-import { Space, Tag, Button, Layout, Popconfirm } from "antd";
+import { Tag, Button, Layout, Popconfirm, Select, Space } from "antd";
 
 
 import GroupAddMember from "./AddMember";
 import GroupAddMember from "./AddMember";
-import { delete_, get } from "../../request";
-import type {
-  IGroupMemberDeleteResponse,
-  IGroupMemberListResponse,
-} from "../../api/group";
 import User from "../auth/User";
 import User from "../auth/User";
 import type { IUser } from "../../api/Auth";
 import type { IUser } from "../../api/Auth";
+import {
+  ASSIGNABLE_GROUP_ROLES,
+  canManageMembers,
+  fetchGroupMembers,
+  removeGroupMember,
+  updateGroupMemberRole,
+  type AssignableGroupRole,
+  type GroupMember,
+} from "../../api/group-member";
+import { useAppSelector } from "../../hooks";
+import { studioList } from "../../reducers/current-user";
 
 
 const { Content } = Layout;
 const { Content } = Layout;
 
 
-interface IRoleTag {
-  title: string;
-  color: string;
-}
-interface DataItem {
-  id: number;
-  userId: string;
-  name?: string;
-  user: IUser;
-  tag: IRoleTag[];
-  image: string;
-}
+const ROLE_COLOR: Record<string, string> = {
+  owner: "success",
+  manager: "processing",
+  editor: "blue",
+  reader: "default",
+};
+
 interface IWidgetGroupFile {
 interface IWidgetGroupFile {
   groupId?: string;
   groupId?: string;
 }
 }
 const GroupMemberWidget = ({ groupId }: IWidgetGroupFile) => {
 const GroupMemberWidget = ({ groupId }: IWidgetGroupFile) => {
   const intl = useIntl(); //i18n
   const intl = useIntl(); //i18n
-  const [canManage, setCanManage] = useState(false);
   const [memberCount, setMemberCount] = useState<number>();
   const [memberCount, setMemberCount] = useState<number>();
+  const studios = useAppSelector(studioList);
+
+  // 我在这个团队里的角色来自 /v3/me/groups(成员列表分页,自己那行不一定在当前页)
+  const myRole = studios?.find((item) => item.id === groupId)?.role;
+  const canManage = canManageMembers(myRole);
+
+  const roleLabel = (role?: string) =>
+    intl.formatMessage({ id: `labels.group.role.${role ?? "reader"}` });
 
 
   const ref = useRef<ActionType | null>(null);
   const ref = useRef<ActionType | null>(null);
+  const reload = () => ref.current?.reload();
+
   return (
   return (
     <Content>
     <Content>
-      <ProList<DataItem>
+      <ProList<GroupMember>
         rowKey="id"
         rowKey="id"
         actionRef={ref}
         actionRef={ref}
+        // groupId 放进 params:切换团队(团队空间或团队详情页)时 ProList 才会重新请求
+        params={{ groupId }}
         headerTitle={
         headerTitle={
           intl.formatMessage({ id: "group.member" }) +
           intl.formatMessage({ id: "group.member" }) +
           "-" +
           "-" +
-          memberCount?.toString()
+          (memberCount?.toString() ?? "")
         }
         }
-        toolBarRender={() => {
-          return [
-            canManage ? (
-              <GroupAddMember
-                groupId={groupId}
-                onCreated={() => {
-                  ref.current?.reload();
-                }}
-              />
-            ) : undefined,
-          ];
-        }}
-        request={async (params = {}, sorter, filter) => {
-          console.log(params, sorter, filter);
-
-          let url = `/api/v2/group-member?view=group&id=${groupId}`;
-          const offset =
-            ((params.current ? params.current : 1) - 1) *
-            (params.pageSize ? params.pageSize : 20);
-          url += `&limit=${params.pageSize}&offset=${offset}`;
-          if (typeof params.keyword !== "undefined") {
-            url += "&search=" + (params.keyword ? params.keyword : "");
+        toolBarRender={() => [
+          canManage && groupId ? (
+            <GroupAddMember key="add" groupId={groupId} onCreated={reload} />
+          ) : undefined,
+        ]}
+        request={async (params = {}) => {
+          if (!groupId) {
+            return { total: 0, success: false, data: [] };
           }
           }
-          const res = await get<IGroupMemberListResponse>(url);
-          if (res.ok) {
-            console.log(res.data.rows);
-            setMemberCount(res.data.count);
-            switch (res.data.role) {
-              case "owner":
-                setCanManage(true);
-                break;
-              case "manager":
-                setCanManage(true);
-                break;
-            }
-            const items: DataItem[] = res.data.rows.map((item) => {
-              const member: DataItem = {
-                id: item.id ? item.id : 0,
-                userId: item.user_id,
-                name: item.user?.nickName,
-                user: item.user,
-                tag: [],
-                image: "",
-              };
-              switch (item.power) {
-                case 0:
-                  member.tag.push({ title: "拥有者", color: "success" });
-                  break;
-                case 1:
-                  member.tag.push({ title: "管理员", color: "default" });
-                  break;
-              }
-
-              return member;
-            });
-            console.log(items);
+          try {
+            const res = await fetchGroupMembers(
+              groupId,
+              params.current ?? 1,
+              params.pageSize ?? 20
+            );
+            setMemberCount(res.meta?.total);
             return {
             return {
-              total: res.data.count,
-              succcess: true,
-              data: items,
-            };
-          } else {
-            console.error(res.message);
-            return {
-              total: 0,
-              succcess: false,
-              data: [],
+              total: res.meta?.total ?? 0,
+              success: true,
+              data: res.data ?? [],
             };
             };
+          } catch {
+            return { total: 0, success: false, data: [] };
           }
           }
         }}
         }}
         pagination={{
         pagination={{
@@ -121,61 +88,59 @@ const GroupMemberWidget = ({ groupId }: IWidgetGroupFile) => {
         }}
         }}
         metas={{
         metas={{
           title: {
           title: {
-            dataIndex: "name",
+            render: (_dom, row) => row.user?.nickName,
           },
           },
           avatar: {
           avatar: {
-            dataIndex: "image",
             editable: false,
             editable: false,
-            render(_dom, entity) {
-              return <User {...entity.user} showName={false} />;
-            },
+            render: (_dom, row) => (
+              <User {...(row.user as IUser)} showName={false} />
+            ),
           },
           },
           subTitle: {
           subTitle: {
-            render: (_text, row, index) => {
-              const showtag = row.tag.map((item, id) => {
-                return (
-                  <Tag color={item.color} key={id}>
-                    {item.title}
-                  </Tag>
-                );
-              });
-              return (
-                <Space size={0} key={index}>
-                  {showtag}
-                </Space>
-              );
-            },
-          },
-          actions: {
-            render: (_text, row, index) => [
-              canManage ? (
-                <Popconfirm
-                  key={index}
-                  title={intl.formatMessage({
-                    id: "forms.message.member.remove",
-                  })}
-                  onConfirm={() => {
-                    console.log("delete", row.id);
-                    delete_<IGroupMemberDeleteResponse>(
-                      "/api/v2/group-member/" + row.id
-                    ).then((json) => {
-                      if (json.ok) {
-                        console.log("delete ok");
-                        ref.current?.reload();
-                      }
-                    });
+            render: (_dom, row) =>
+              canManage && row.role !== "owner" ? (
+                <Select<AssignableGroupRole>
+                  size="small"
+                  variant="borderless"
+                  value={row.role as AssignableGroupRole}
+                  options={ASSIGNABLE_GROUP_ROLES.map((role) => ({
+                    value: role,
+                    label: roleLabel(role),
+                  }))}
+                  onChange={(role) => {
+                    if (groupId && row.id) {
+                      updateGroupMemberRole(groupId, row.id, role).then(reload);
+                    }
                   }}
                   }}
-                  okText={intl.formatMessage({ id: "buttons.ok" })}
-                  cancelText={intl.formatMessage({ id: "buttons.cancel" })}
-                >
-                  <Button size="small" type="link" danger key="link">
-                    {intl.formatMessage({ id: "buttons.remove" })}
-                  </Button>
-                </Popconfirm>
+                />
               ) : (
               ) : (
-                <></>
+                <Tag color={ROLE_COLOR[row.role ?? "reader"]}>
+                  {roleLabel(row.role)}
+                </Tag>
               ),
               ),
-            ],
+          },
+          actions: {
+            render: (_dom, row) =>
+              canManage && row.role !== "owner" ? (
+                <Space>
+                  <Popconfirm
+                    title={intl.formatMessage({
+                      id: "forms.message.member.remove",
+                    })}
+                    onConfirm={() => {
+                      if (groupId && row.id) {
+                        removeGroupMember(groupId, row.id).then(reload);
+                      }
+                    }}
+                    okText={intl.formatMessage({ id: "buttons.ok" })}
+                    cancelText={intl.formatMessage({ id: "buttons.cancel" })}
+                  >
+                    <Button size="small" type="link" danger>
+                      {intl.formatMessage({ id: "buttons.remove" })}
+                    </Button>
+                  </Popconfirm>
+                </Space>
+              ) : null,
           },
           },
         }}
         }}
       />
       />

+ 7 - 13
dashboard-v6/src/components/group/GroupSelect.tsx

@@ -1,8 +1,7 @@
 import { ProFormSelect } from "@ant-design/pro-components";
 import { ProFormSelect } from "@ant-design/pro-components";
 import { useIntl } from "react-intl";
 import { useIntl } from "react-intl";
 
 
-import { get } from "../../request";
-import type { IGroupListResponse } from "../../api/group";
+import { searchGroups } from "../../api/group";
 
 
 interface IWidget {
 interface IWidget {
   name?: string;
   name?: string;
@@ -29,17 +28,12 @@ const GroupSelectWidget = ({
         mode: multiple ? "multiple" : undefined,
         mode: multiple ? "multiple" : undefined,
       }}
       }}
       request={async ({ keyWords }) => {
       request={async ({ keyWords }) => {
-        const url = `/api/v2/group?view=all&search=${keyWords}`;
-        console.log("group keyWord", url);
-        const json = await get<IGroupListResponse>(url);
-        const userList = json.data.rows.map((item) => {
-          return {
-            value: item.uid,
-            label: `${item.studio.studioName}/${item.name}`,
-          };
-        });
-
-        return userList;
+        // 只搜得到公开团队
+        const groups = await searchGroups(keyWords ?? "");
+        return groups.map((item) => ({
+          value: item.id,
+          label: `${item.owner?.userName ?? ""}/${item.name}`,
+        }));
       }}
       }}
       rules={[
       rules={[
         {
         {

+ 28 - 7
dashboard-v6/src/components/navigation/MainMenu.tsx

@@ -122,15 +122,16 @@ function findOpenKeys(
 /* ================= 团队空间置灰 ================= */
 /* ================= 团队空间置灰 ================= */
 
 
 /**
 /**
- * 团队空间下把不可用的菜单置灰并给出原因;有子菜单的,子项全灰才灰。
+ * 把当前空间(个人 / 团队)下不可用的菜单置灰并给出原因;有子菜单的,子项全灰才灰。
  */
  */
 function applyTeamspace(
 function applyTeamspace(
   items: MenuItem[],
   items: MenuItem[],
+  isTeamspace: boolean,
   hint: (id: string) => string
   hint: (id: string) => string
 ): MenuItem[] {
 ): MenuItem[] {
   return items.map((item) => {
   return items.map((item) => {
     if (item.children) {
     if (item.children) {
-      const children = applyTeamspace(item.children, hint);
+      const children = applyTeamspace(item.children, isTeamspace, hint);
       return {
       return {
         ...item,
         ...item,
         children,
         children,
@@ -140,7 +141,7 @@ function applyTeamspace(
     const scopeId =
     const scopeId =
       item.scopeId ??
       item.scopeId ??
       (typeof item.activeId === "string" ? item.activeId : undefined);
       (typeof item.activeId === "string" ? item.activeId : undefined);
-    const availability = teamspaceAvailability(scopeId);
+    const availability = teamspaceAvailability(scopeId, isTeamspace);
     if (item.type === "divider" || availability === "available") {
     if (item.type === "divider" || availability === "available") {
       return item;
       return item;
     }
     }
@@ -157,6 +158,21 @@ function applyTeamspace(
   });
   });
 }
 }
 
 
+/* ================= 交给 antd 前去掉内部字段 ================= */
+
+/** activeId / scopeId 只给本文件用,透传给 antd 会落到 DOM 上并报警告 */
+function toAntdItems(items: MenuItem[]): MenuProps["items"] {
+  return items.map((item) => {
+    const rest: Partial<MenuItem> = { ...item };
+    delete rest.activeId;
+    delete rest.scopeId;
+    if (item.children) {
+      rest.children = toAntdItems(item.children) as MenuItem[];
+    }
+    return rest;
+  }) as MenuProps["items"];
+}
+
 /* ================= 组件 ================= */
 /* ================= 组件 ================= */
 interface Props {
 interface Props {
   onSearch?: () => void;
   onSearch?: () => void;
@@ -375,6 +391,11 @@ const Widget = ({ onSearch }: Props) => {
           }),
           }),
           activeId: "workspace.team",
           activeId: "workspace.team",
         },
         },
+        {
+          key: "/workspace/members",
+          label: intl.formatMessage({ id: "labels.teamspace.members" }),
+          activeId: "workspace.members",
+        },
         {
         {
           key: "/workspace/invite",
           key: "/workspace/invite",
           label: intl.formatMessage({
           label: intl.formatMessage({
@@ -392,9 +413,9 @@ const Widget = ({ onSearch }: Props) => {
       ],
       ],
     },
     },
   ];
   ];
-  const items = isTeamspace
-    ? applyTeamspace(allItems, (id) => intl.formatMessage({ id }))
-    : allItems;
+  const items = applyTeamspace(allItems, isTeamspace, (id) =>
+    intl.formatMessage({ id })
+  );
 
 
   /** 当前选中 */
   /** 当前选中 */
   const selectedKey = findSelectedKey(items, routeId);
   const selectedKey = findSelectedKey(items, routeId);
@@ -423,7 +444,7 @@ const Widget = ({ onSearch }: Props) => {
         mode="inline"
         mode="inline"
         selectedKeys={selectedKey ? [selectedKey] : []}
         selectedKeys={selectedKey ? [selectedKey] : []}
         defaultOpenKeys={openKeys}
         defaultOpenKeys={openKeys}
-        items={items as MenuProps["items"]}
+        items={toAntdItems(items)}
         onClick={handleClick}
         onClick={handleClick}
         style={{ borderRight: 0 }}
         style={{ borderRight: 0 }}
       />
       />

+ 37 - 17
dashboard-v6/src/features/group/GroupEdit.tsx

@@ -2,19 +2,23 @@ import { useState } from "react";
 import { useIntl } from "react-intl";
 import { useIntl } from "react-intl";
 import {
 import {
   ProForm,
   ProForm,
+  ProFormRadio,
   ProFormText,
   ProFormText,
   ProFormTextArea,
   ProFormTextArea,
 } from "@ant-design/pro-components";
 } from "@ant-design/pro-components";
 import { message, Card } from "antd";
 import { message, Card } from "antd";
 
 
-import { get, put } from "../../request";
-
-import type { IGroupRequest, IGroupResponse } from "../../api/group";
+import {
+  fetchGroup,
+  GROUP_STATUS_PRIVATE,
+  GROUP_STATUS_PUBLIC,
+  updateGroup,
+} from "../../api/group";
 
 
 interface IFormData {
 interface IFormData {
-  id: string;
   name: string;
   name: string;
   description: string;
   description: string;
+  status: number;
 }
 }
 
 
 interface IWidget {
 interface IWidget {
@@ -29,24 +33,23 @@ const GroupEdit = ({ groupId }: IWidget) => {
     <Card title={title}>
     <Card title={title}>
       <ProForm<IFormData>
       <ProForm<IFormData>
         onFinish={async (values: IFormData) => {
         onFinish={async (values: IFormData) => {
-          console.log(values);
-          const res = await put<IGroupRequest, IGroupResponse>(
-            `/api/v2/group/${groupId}`,
-            values
-          );
-          if (res.ok) {
-            message.success(intl.formatMessage({ id: "flashes.success" }));
+          if (!groupId) {
+            return;
           }
           }
+          // owner / manager 才能改;失败由 unwrap 统一弹提示
+          const group = await updateGroup(groupId, values);
+          setTitle(group?.name ?? values.name);
+          message.success(intl.formatMessage({ id: "flashes.success" }));
         }}
         }}
         formKey="group_edit"
         formKey="group_edit"
         request={async () => {
         request={async () => {
-          const res = await get<IGroupResponse>(`/api/v2/group/${groupId}`);
-          setTitle(res.data.name);
-          document.title = `${res.data.name}`;
+          const group = await fetchGroup(groupId ?? "");
+          setTitle(group.name ?? "");
+          document.title = `${group.name}`;
           return {
           return {
-            id: res.data.uid,
-            name: res.data.name,
-            description: res.data.description,
+            name: group.name ?? "",
+            description: group.description ?? "",
+            status: group.status ?? GROUP_STATUS_PUBLIC,
           };
           };
         }}
         }}
       >
       >
@@ -64,6 +67,23 @@ const GroupEdit = ({ groupId }: IWidget) => {
           />
           />
         </ProForm.Group>
         </ProForm.Group>
 
 
+        <ProForm.Group>
+          <ProFormRadio.Group
+            name="status"
+            label={intl.formatMessage({ id: "labels.group.visibility" })}
+            options={[
+              {
+                value: GROUP_STATUS_PUBLIC,
+                label: intl.formatMessage({ id: "labels.group.public" }),
+              },
+              {
+                value: GROUP_STATUS_PRIVATE,
+                label: intl.formatMessage({ id: "labels.group.private" }),
+              },
+            ]}
+          />
+        </ProForm.Group>
+
         <ProForm.Group>
         <ProForm.Group>
           <ProFormTextArea
           <ProFormTextArea
             width="md"
             width="md"

+ 72 - 75
dashboard-v6/src/features/group/GroupList.tsx

@@ -7,28 +7,18 @@ import {
   ExclamationCircleOutlined,
   ExclamationCircleOutlined,
 } from "@ant-design/icons";
 } from "@ant-design/icons";
 
 
-import { delete_, get } from "../../request";
-
 import GroupCreate from "../../components/group/GroupCreate";
 import GroupCreate from "../../components/group/GroupCreate";
-import { RoleValueEnum } from "../../components/studio/table";
 
 
-import { useEffect, useRef, useState } from "react";
+import { useCallback, useEffect, useRef, useState } from "react";
 
 
 import StudioName from "../../components/auth/Studio";
 import StudioName from "../../components/auth/Studio";
 
 
-import { getSorterUrl } from "../../utils";
 import type { IStudio } from "../../api/Auth";
 import type { IStudio } from "../../api/Auth";
-import type { IDeleteResponse, IGroupListResponse } from "../../api/group";
+import { deleteGroup } from "../../api/group";
+import { fetchMyGroupsPage } from "../../api/group-member";
 import StatusBadge from "../../components/general/StatusBadge";
 import StatusBadge from "../../components/general/StatusBadge";
-
-interface IMyNumberResponse {
-  ok: boolean;
-  message: string;
-  data: {
-    my: number;
-    collaboration: number;
-  };
-}
+import { useAppDispatch } from "../../hooks";
+import { refreshMyGroups } from "../teamspace/refreshMyGroups";
 
 
 interface DataItem {
 interface DataItem {
   sn: number;
   sn: number;
@@ -41,31 +31,36 @@ interface DataItem {
 }
 }
 
 
 interface IWidget {
 interface IWidget {
-  studioName?: string;
   onSelect?: (id: string) => void;
   onSelect?: (id: string) => void;
   onSetting?: (id: string) => void;
   onSetting?: (id: string) => void;
 }
 }
-const GroupList = ({ studioName, onSelect, onSetting }: IWidget) => {
+/** 我的团队:「我创建的」与「我参加的」两个标签页(v3 /me/groups 的 owned 过滤) */
+const GroupList = ({ onSelect, onSetting }: IWidget) => {
   const intl = useIntl(); //i18n
   const intl = useIntl(); //i18n
+  const dispatch = useAppDispatch();
 
 
   const [openCreate, setOpenCreate] = useState(false);
   const [openCreate, setOpenCreate] = useState(false);
   const [activeKey, setActiveKey] = useState<React.Key | undefined>("my");
   const [activeKey, setActiveKey] = useState<React.Key | undefined>("my");
   const [myNumber, setMyNumber] = useState<number>(0);
   const [myNumber, setMyNumber] = useState<number>(0);
   const [collaborationNumber, setCollaborationNumber] = useState<number>(0);
   const [collaborationNumber, setCollaborationNumber] = useState<number>(0);
 
 
-  useEffect(() => {
-    /**
-     * 获取各种课程的数量
-     */
-    const url = `/api/v2/group-my-number?studio=${studioName}`;
-    console.log("url", url);
-    get<IMyNumberResponse>(url).then((json) => {
-      if (json.ok) {
-        setMyNumber(json.data.my);
-        setCollaborationNumber(json.data.collaboration);
-      }
-    });
-  }, [studioName]);
+  /** 两个标签页的数量:各取一条,读 meta.total */
+  const refreshNumbers = useCallback(() => {
+    fetchMyGroupsPage({ owned: true, per_page: 1 }).then((res) =>
+      setMyNumber(res.meta?.total ?? 0)
+    );
+    fetchMyGroupsPage({ owned: false, per_page: 1 }).then((res) =>
+      setCollaborationNumber(res.meta?.total ?? 0)
+    );
+  }, []);
+  useEffect(refreshNumbers, [refreshNumbers]);
+
+  /** 建、删团队后:刷新列表、数量,以及头像弹窗里的账户列表 */
+  const afterChange = () => {
+    ref.current?.reload();
+    refreshNumbers();
+    refreshMyGroups(dispatch).catch(() => undefined);
+  };
 
 
   const showDeleteConfirm = (id: string, title: string) => {
   const showDeleteConfirm = (id: string, title: string) => {
     Modal.confirm({
     Modal.confirm({
@@ -86,18 +81,11 @@ const GroupList = ({ studioName, onSelect, onSetting }: IWidget) => {
       cancelText: intl.formatMessage({
       cancelText: intl.formatMessage({
         id: "buttons.no",
         id: "buttons.no",
       }),
       }),
-      onOk() {
-        console.log("delete", id);
-        return delete_<IDeleteResponse>(`/api/v2/group/${id}`)
-          .then((json) => {
-            if (json.ok) {
-              message.success("删除成功");
-              ref.current?.reload();
-            } else {
-              message.error(json.message);
-            }
-          })
-          .catch((e) => console.log("Oops errors!", e));
+      async onOk() {
+        // 只有 owner 能删;名下还有资源时后端 409,原因由 unwrap 弹出
+        await deleteGroup(id);
+        message.success(intl.formatMessage({ id: "flashes.success" }));
+        afterChange();
       },
       },
     });
     });
   };
   };
@@ -164,7 +152,16 @@ const GroupList = ({ studioName, onSelect, onSetting }: IWidget) => {
             search: false,
             search: false,
             filters: true,
             filters: true,
             onFilter: true,
             onFilter: true,
-            valueEnum: RoleValueEnum(),
+            valueEnum: Object.fromEntries(
+              ["owner", "manager", "editor", "reader"].map((role) => [
+                role,
+                {
+                  text: intl.formatMessage({
+                    id: `labels.group.role.${role}`,
+                  }),
+                },
+              ])
+            ),
           },
           },
           {
           {
             title: intl.formatMessage({
             title: intl.formatMessage({
@@ -175,7 +172,6 @@ const GroupList = ({ studioName, onSelect, onSetting }: IWidget) => {
             search: false,
             search: false,
             dataIndex: "created_at",
             dataIndex: "created_at",
             valueType: "date",
             valueType: "date",
-            sorter: true,
           },
           },
           {
           {
             title: intl.formatMessage({ id: "buttons.option" }),
             title: intl.formatMessage({ id: "buttons.option" }),
@@ -219,35 +215,37 @@ const GroupList = ({ studioName, onSelect, onSetting }: IWidget) => {
             ],
             ],
           },
           },
         ]}
         ]}
-        request={async (params = {}, sorter, filter) => {
-          console.log(params, sorter, filter);
-          let url = `/api/v2/group?view=studio&name=${studioName}&view2=${activeKey}`;
-          const offset =
-            ((params.current ? params.current : 1) - 1) *
-            (params.pageSize ? params.pageSize : 20);
-          url += `&limit=${params.pageSize}&offset=${offset}`;
-          url += params.keyword ? "&search=" + params.keyword : "";
-          url += getSorterUrl(sorter);
-
-          console.log(url);
-          const res = await get<IGroupListResponse>(url);
-          const items: DataItem[] = res.data.rows.map((item, id) => {
-            return {
-              sn: id + 1,
-              id: item.uid,
-              name: item.name,
-              description: item.description,
-              role: item.role,
-              created_at: item.created_at,
-              studio: item.studio,
-            };
-          });
-          console.log(items);
-          return {
-            total: res.data.count,
-            succcess: true,
-            data: items,
-          };
+        request={async (params = {}) => {
+          const page = params.current ?? 1;
+          const perPage = params.pageSize ?? 20;
+          try {
+            const res = await fetchMyGroupsPage({
+              owned: activeKey === "my",
+              search: params.keyword || undefined,
+              page,
+              per_page: perPage,
+            });
+            const items: DataItem[] = (res.data ?? []).map((item, index) => ({
+              sn: (page - 1) * perPage + index + 1,
+              id: item.id ?? "",
+              name: item.name ?? "",
+              description: item.description ?? "",
+              role: item.role ?? "",
+              created_at: item.created_at ?? "",
+              studio: item.owner
+                ? {
+                    id: item.owner.id ?? "",
+                    nickName: item.owner.nickName,
+                    realName: item.owner.realName,
+                    studioName: item.owner.userName,
+                    avatar: item.owner.avatar ?? undefined,
+                  }
+                : undefined,
+            }));
+            return { total: res.meta?.total ?? 0, success: true, data: items };
+          } catch {
+            return { total: 0, success: false, data: [] };
+          }
         }}
         }}
         rowKey="id"
         rowKey="id"
         bordered
         bordered
@@ -263,10 +261,9 @@ const GroupList = ({ studioName, onSelect, onSetting }: IWidget) => {
           <Popover
           <Popover
             content={
             content={
               <GroupCreate
               <GroupCreate
-                studio={studioName}
                 onCreate={() => {
                 onCreate={() => {
                   setOpenCreate(false);
                   setOpenCreate(false);
-                  ref.current?.reload();
+                  afterChange();
                 }}
                 }}
               />
               />
             }
             }

+ 33 - 4
dashboard-v6/src/features/group/GroupShow.tsx

@@ -1,10 +1,15 @@
 import { useIntl } from "react-intl";
 import { useIntl } from "react-intl";
-import { Button, Card, Space } from "antd";
+import { useNavigate } from "react-router";
+import { Button, Card, Popconfirm, Space } from "antd";
 import { Col, Row } from "antd";
 import { Col, Row } from "antd";
 import { SettingOutlined } from "@ant-design/icons";
 import { SettingOutlined } from "@ant-design/icons";
 
 
 import GroupFile from "../../components/group/GroupFile";
 import GroupFile from "../../components/group/GroupFile";
 import GroupMember from "../../components/group/GroupMember";
 import GroupMember from "../../components/group/GroupMember";
+import { removeGroupMember } from "../../api/group-member";
+import { useAppDispatch, useAppSelector } from "../../hooks";
+import { studioList } from "../../reducers/current-user";
+import { refreshMyGroups } from "../teamspace/refreshMyGroups";
 
 
 interface IWidget {
 interface IWidget {
   teamId?: string;
   teamId?: string;
@@ -12,14 +17,38 @@ interface IWidget {
 }
 }
 const GroupShow = ({ teamId, onSetting }: IWidget) => {
 const GroupShow = ({ teamId, onSetting }: IWidget) => {
   const intl = useIntl();
   const intl = useIntl();
+  const navigate = useNavigate();
+  const dispatch = useAppDispatch();
+  const studios = useAppSelector(studioList);
+
+  // 我在这个团队里的成员记录;owner 不能退出
+  const mine = studios?.find((item) => item.id === teamId);
+  const canLeave = !!mine?.memberId && mine.role !== "owner";
 
 
   return (
   return (
     <Card
     <Card
       extra={
       extra={
         <Space>
         <Space>
-          <Button type="link" danger>
-            {intl.formatMessage({ id: "buttons.group.exit" })}
-          </Button>
+          {canLeave && (
+            <Popconfirm
+              title={intl.formatMessage({ id: "forms.message.group.leave" })}
+              onConfirm={async () => {
+                if (!teamId || !mine?.memberId) {
+                  return;
+                }
+                await removeGroupMember(teamId, mine.memberId);
+                // 退出的若正是当前团队空间,refreshMyGroups 会顺带切回个人空间
+                await refreshMyGroups(dispatch);
+                navigate("/workspace/team");
+              }}
+              okText={intl.formatMessage({ id: "buttons.ok" })}
+              cancelText={intl.formatMessage({ id: "buttons.cancel" })}
+            >
+              <Button type="link" danger>
+                {intl.formatMessage({ id: "buttons.group.exit" })}
+              </Button>
+            </Popconfirm>
+          )}
           <Button type="link" icon={<SettingOutlined />} onClick={onSetting} />
           <Button type="link" icon={<SettingOutlined />} onClick={onSetting} />
         </Space>
         </Space>
       }
       }

+ 9 - 7
dashboard-v6/src/features/teamspace/TeamspaceGuard.tsx

@@ -8,8 +8,8 @@ import { useCurrentRouteId } from "../../hooks/useCurrentRouteId";
 import { TEAMSPACE_HINT, teamspaceAvailability } from "./scope";
 import { TEAMSPACE_HINT, teamspaceAvailability } from "./scope";
 
 
 /**
 /**
- * 团队空间下拦住还不能用的页面(菜单置灰之外,直接输入地址也进不去)。
- * 个人空间下原样渲染。
+ * 拦住当前空间下不能用的页面(菜单置灰之外,直接输入地址也进不去):
+ * 团队空间里拦个人专属与尚未支持的模块,个人空间里拦只属于团队空间的页面。
  */
  */
 const TeamspaceGuard = ({ children }: { children: React.ReactNode }) => {
 const TeamspaceGuard = ({ children }: { children: React.ReactNode }) => {
   const intl = useIntl();
   const intl = useIntl();
@@ -17,8 +17,8 @@ const TeamspaceGuard = ({ children }: { children: React.ReactNode }) => {
   const routeId = useCurrentRouteId();
   const routeId = useCurrentRouteId();
   const { isTeamspace } = useActiveStudio();
   const { isTeamspace } = useActiveStudio();
 
 
-  const availability = teamspaceAvailability(routeId);
-  if (!isTeamspace || availability === "available") {
+  const availability = teamspaceAvailability(routeId, isTeamspace);
+  if (availability === "available") {
     return <>{children}</>;
     return <>{children}</>;
   }
   }
 
 
@@ -28,9 +28,11 @@ const TeamspaceGuard = ({ children }: { children: React.ReactNode }) => {
         status="info"
         status="info"
         title={intl.formatMessage({ id: TEAMSPACE_HINT[availability] })}
         title={intl.formatMessage({ id: TEAMSPACE_HINT[availability] })}
         extra={
         extra={
-          <Button type="primary" onClick={() => dispatch(studioSignOut())}>
-            {intl.formatMessage({ id: "buttons.teamspace.leave" })}
-          </Button>
+          isTeamspace ? (
+            <Button type="primary" onClick={() => dispatch(studioSignOut())}>
+              {intl.formatMessage({ id: "buttons.teamspace.leave" })}
+            </Button>
+          ) : undefined
         }
         }
       />
       />
     </div>
     </div>

+ 24 - 0
dashboard-v6/src/features/teamspace/refreshMyGroups.ts

@@ -0,0 +1,24 @@
+import type { IStudio } from "../../api/Auth";
+import { fetchMyGroups } from "../../api/group-member";
+import type { AppDispatch } from "../../store";
+import { recallCurrStudio, studioSignIn } from "../../reducers/current-user";
+
+/**
+ * 重新取「我加入的团队」,更新头像弹窗里的账户列表,并校验当前团队空间。
+ *
+ * 团队要套进 IStudio 的形状:`realName` 填团队 uid——v2 接口的 `studio` / `name`
+ * 参数靠 `StudioApi::getIdByName()` 解析,它对团队认的是 uid。
+ */
+export async function refreshMyGroups(dispatch: AppDispatch): Promise<void> {
+  const groups = await fetchMyGroups();
+  const studios: IStudio[] = groups.map((group) => ({
+    id: group.id ?? "",
+    nickName: group.name,
+    studioName: group.name,
+    realName: group.id,
+    role: group.role,
+    memberId: group.member_id,
+  }));
+  dispatch(studioSignIn(studios));
+  dispatch(recallCurrStudio());
+}

+ 19 - 5
dashboard-v6/src/features/teamspace/scope.ts

@@ -3,14 +3,16 @@
  *
  *
  * 团队空间 = 以某个 group 为 owner 浏览资源。后端只有迁到 v3 的资源才认
  * 团队空间 = 以某个 group 为 owner 浏览资源。后端只有迁到 v3 的资源才认
  * 「owner 是 group、成员按角色拥有权限」,所以模块要等它的资源迁完才能开放。
  * 「owner 是 group、成员按角色拥有权限」,所以模块要等它的资源迁完才能开放。
- * 每迁完一个,就把它的路由 id 从 NOT_YET_SUPPORTED 删掉;全部删完后这一组连同
- * 菜单上的置灰逻辑一起去掉,只留 PERSONAL_ONLY。
+ * 每迁完一个,就把它的路由 id 从 NOT_YET_SUPPORTED 删掉;全部删完后这一组去掉,
+ * 只留 PERSONAL_ONLY 与 TEAMSPACE_ONLY。
  *
  *
  * 值是路由的 handle.id,前缀匹配(`workspace.task` 同时覆盖 `workspace.task.list`)。
  * 值是路由的 handle.id,前缀匹配(`workspace.task` 同时覆盖 `workspace.task.list`)。
  */
  */
 
 
 /** 只属于个人、团队空间下永远不可用 */
 /** 只属于个人、团队空间下永远不可用 */
 const PERSONAL_ONLY = [
 const PERSONAL_ONLY = [
+  // 「我加入的团队」列表与团队详情是个人身份的东西;进了团队空间,管理本团队走「成员管理」
+  "workspace.team",
   "workspace.settings",
   "workspace.settings",
   "workspace.recent",
   "workspace.recent",
   "workspace.dict",
   "workspace.dict",
@@ -30,18 +32,29 @@ const NOT_YET_SUPPORTED = [
   "workspace.driver",
   "workspace.driver",
 ];
 ];
 
 
-export type TeamspaceAvailability = "available" | "personal" | "unsupported";
+/** 只在团队空间里有意义,个人空间下不可用 */
+const TEAMSPACE_ONLY = ["workspace.members"];
+
+export type TeamspaceAvailability =
+  | "available"
+  | "personal"
+  | "unsupported"
+  | "teamspace-only";
 
 
 const matches = (routeId: string, list: string[]) =>
 const matches = (routeId: string, list: string[]) =>
   list.some((id) => routeId === id || routeId.startsWith(id + "."));
   list.some((id) => routeId === id || routeId.startsWith(id + "."));
 
 
-/** 某个路由在团队空间下能不能用;没有 id 的路由一律可用 */
+/** 某个路由在当前空间(个人 / 团队)下能不能用;没有 id 的路由一律可用 */
 export function teamspaceAvailability(
 export function teamspaceAvailability(
-  routeId: string | undefined
+  routeId: string | undefined,
+  isTeamspace: boolean
 ): TeamspaceAvailability {
 ): TeamspaceAvailability {
   if (!routeId) {
   if (!routeId) {
     return "available";
     return "available";
   }
   }
+  if (!isTeamspace) {
+    return matches(routeId, TEAMSPACE_ONLY) ? "teamspace-only" : "available";
+  }
   if (matches(routeId, PERSONAL_ONLY)) {
   if (matches(routeId, PERSONAL_ONLY)) {
     return "personal";
     return "personal";
   }
   }
@@ -58,4 +71,5 @@ export const TEAMSPACE_HINT: Record<
 > = {
 > = {
   personal: "labels.teamspace.personal-only",
   personal: "labels.teamspace.personal-only",
   unsupported: "labels.teamspace.unsupported",
   unsupported: "labels.teamspace.unsupported",
+  "teamspace-only": "labels.teamspace.only",
 };
 };

+ 4 - 15
dashboard-v6/src/load.ts

@@ -5,8 +5,6 @@ import {
   get as getToken,
   get as getToken,
   guest,
   guest,
   signIn,
   signIn,
-  studioSignIn,
-  recallCurrStudio,
 } from "./reducers/current-user";
 } from "./reducers/current-user";
 import { remove as removeToken } from "./reducers/session";
 import { remove as removeToken } from "./reducers/session";
 import { fetchMe } from "./api/session";
 import { fetchMe } from "./api/session";
@@ -26,10 +24,9 @@ import { grammar, type ITerm, update } from "./reducers/term-vocabulary";
 import { push as nissayaEndingPush } from "./reducers/nissaya-ending-vocabulary";
 import { push as nissayaEndingPush } from "./reducers/nissaya-ending-vocabulary";
 
 
 import { pushRelation } from "./reducers/relation";
 import { pushRelation } from "./reducers/relation";
-import type { IGroupMemberListResponse } from "./api/group";
 
 
 import type { IAiModel } from "./api/ai";
 import type { IAiModel } from "./api/ai";
-import type { IStudio } from "./api/Auth";
+import { refreshMyGroups } from "./features/teamspace/refreshMyGroups";
 import type { IRelation, IRelationListResponse } from "./api/relation";
 import type { IRelation, IRelationListResponse } from "./api/relation";
 
 
 export interface ISettingModels {
 export interface ISettingModels {
@@ -94,17 +91,9 @@ const init = () => {
         store.dispatch(guest(true));
         store.dispatch(guest(true));
       });
       });
 
 
-    get<IGroupMemberListResponse>("/api/v2/group-member?view=user").then(
-      (response) => {
-        console.log("auth", response);
-        if (response.ok) {
-          const it: IStudio[] = response.data.rows.map((item) => {
-            return item.group;
-          });
-          store.dispatch(studioSignIn(it));
-          store.dispatch(recallCurrStudio());
-        }
-      }
+    // 团队列表取不到不影响使用:账户列表里只剩个人,团队空间沿用 localStorage 里的,下次启动再校验
+    refreshMyGroups(store.dispatch).catch((e: unknown) =>
+      console.warn("fetch my groups failed", e)
     );
     );
   } else {
   } else {
     console.log("no token");
     console.log("no token");

+ 1 - 0
dashboard-v6/src/locales/en-US/forms.ts

@@ -102,6 +102,7 @@ const items = {
   "group.fields.name.label": "team name",
   "group.fields.name.label": "team name",
   "group.files": "files",
   "group.files": "files",
   "group.member": "members",
   "group.member": "members",
+  "forms.message.group.leave": "Leave this team?",
 };
 };
 
 
 export default items;
 export default items;

+ 13 - 0
dashboard-v6/src/locales/en-US/label.ts

@@ -151,6 +151,19 @@ const items = {
   "labels.teamspace.current": "Teamspace: {name}",
   "labels.teamspace.current": "Teamspace: {name}",
   "labels.teamspace.personal-only": "Personal only — not available in a teamspace",
   "labels.teamspace.personal-only": "Personal only — not available in a teamspace",
   "labels.teamspace.unsupported": "This module does not support teamspaces yet",
   "labels.teamspace.unsupported": "This module does not support teamspaces yet",
+  "labels.group.role.owner": "Owner",
+  "labels.group.role.manager": "Manager",
+  "labels.group.role.editor": "Editor",
+  "labels.group.role.reader": "Reader",
+  "labels.group.role": "Role",
+  "labels.teamspace.members": "Members",
+  "labels.teamspace.only": "Only available in a teamspace",
+  "labels.group.visibility": "Visibility",
+  "labels.group.public": "Public (searchable)",
+  "labels.group.private": "Private (members only)",
+  "labels.group.share.missing": "(deleted)",
+  "labels.group.share.editor": "Can edit",
+  "labels.group.share.reader": "Read only",
 };
 };
 
 
 export default items;
 export default items;

+ 1 - 0
dashboard-v6/src/locales/zh-Hans/forms.ts

@@ -102,6 +102,7 @@ const items = {
   "group.fields.name.label": "团队名",
   "group.fields.name.label": "团队名",
   "group.files": "团队文档",
   "group.files": "团队文档",
   "group.member": "团队成员",
   "group.member": "团队成员",
+  "forms.message.group.leave": "确定退出这个团队吗?",
 };
 };
 
 
 export default items;
 export default items;

+ 13 - 0
dashboard-v6/src/locales/zh-Hans/label.ts

@@ -158,6 +158,19 @@ const items = {
   "labels.teamspace.current": "团队空间:{name}",
   "labels.teamspace.current": "团队空间:{name}",
   "labels.teamspace.personal-only": "个人专属功能,团队空间下不可用",
   "labels.teamspace.personal-only": "个人专属功能,团队空间下不可用",
   "labels.teamspace.unsupported": "该模块暂不支持团队空间",
   "labels.teamspace.unsupported": "该模块暂不支持团队空间",
+  "labels.group.role.owner": "拥有者",
+  "labels.group.role.manager": "管理员",
+  "labels.group.role.editor": "编辑",
+  "labels.group.role.reader": "只读成员",
+  "labels.group.role": "角色",
+  "labels.teamspace.members": "成员管理",
+  "labels.teamspace.only": "仅在团队空间中可用",
+  "labels.group.visibility": "可见性",
+  "labels.group.public": "公开(能被搜到)",
+  "labels.group.private": "私有(只有成员看得到)",
+  "labels.group.share.missing": "(资源已删除)",
+  "labels.group.share.editor": "可编辑",
+  "labels.group.share.reader": "只读",
 };
 };
 
 
 export default items;
 export default items;

+ 1 - 0
dashboard-v6/src/locales/zh-Hant/forms.ts

@@ -102,6 +102,7 @@ const items = {
   "group.fields.name.label": "團隊名",
   "group.fields.name.label": "團隊名",
   "group.files": "團隊文件",
   "group.files": "團隊文件",
   "group.member": "團隊成員",
   "group.member": "團隊成員",
+  "forms.message.group.leave": "確定退出這個團隊嗎?",
 };
 };
 
 
 export default items;
 export default items;

+ 13 - 0
dashboard-v6/src/locales/zh-Hant/label.ts

@@ -158,6 +158,19 @@ const items = {
   "labels.teamspace.current": "團隊空間:{name}",
   "labels.teamspace.current": "團隊空間:{name}",
   "labels.teamspace.personal-only": "個人專屬功能,團隊空間下不可用",
   "labels.teamspace.personal-only": "個人專屬功能,團隊空間下不可用",
   "labels.teamspace.unsupported": "該模組暫不支援團隊空間",
   "labels.teamspace.unsupported": "該模組暫不支援團隊空間",
+  "labels.group.role.owner": "擁有者",
+  "labels.group.role.manager": "管理員",
+  "labels.group.role.editor": "編輯",
+  "labels.group.role.reader": "唯讀成員",
+  "labels.group.role": "角色",
+  "labels.teamspace.members": "成員管理",
+  "labels.teamspace.only": "僅在團隊空間中可用",
+  "labels.group.visibility": "可見性",
+  "labels.group.public": "公開(能被搜到)",
+  "labels.group.private": "私有(只有成員看得到)",
+  "labels.group.share.missing": "(資源已刪除)",
+  "labels.group.share.editor": "可編輯",
+  "labels.group.share.reader": "唯讀",
 };
 };
 
 
 export default items;
 export default items;

+ 25 - 0
dashboard-v6/src/pages/workspace/members/index.tsx

@@ -0,0 +1,25 @@
+import { useIntl } from "react-intl";
+
+import GroupMember from "../../../components/group/GroupMember";
+import { useActiveStudio } from "../../../hooks/useActiveStudio";
+
+/**
+ * 当前团队空间的成员管理。个人空间下由 TeamspaceGuard 拦住,到不了这里。
+ */
+const Widget = () => {
+  const intl = useIntl();
+  const { teamspace } = useActiveStudio();
+
+  return (
+    <>
+      <title>
+        {`${intl.formatMessage({ id: "labels.teamspace.members" })}-${
+          teamspace?.nickName ?? ""
+        }`}
+      </title>
+      {teamspace && <GroupMember groupId={teamspace.id} />}
+    </>
+  );
+};
+
+export default Widget;

+ 0 - 6
dashboard-v6/src/pages/workspace/team/index.tsx

@@ -1,21 +1,15 @@
 import { useNavigate } from "react-router";
 import { useNavigate } from "react-router";
 import { useIntl } from "react-intl";
 import { useIntl } from "react-intl";
 
 
-import { useAppSelector } from "../../../hooks";
-import { currentUser } from "../../../reducers/current-user";
 import GroupList from "../../../features/group/GroupList";
 import GroupList from "../../../features/group/GroupList";
 
 
 const Widget = () => {
 const Widget = () => {
-  const user = useAppSelector(currentUser);
-  const studioName = user?.realName;
   const navigate = useNavigate();
   const navigate = useNavigate();
   const intl = useIntl();
   const intl = useIntl();
-  console.debug("channel list", studioName);
   return (
   return (
     <>
     <>
       <title>{intl.formatMessage({ id: "pages.team.title" })}</title>
       <title>{intl.formatMessage({ id: "pages.team.title" })}</title>
       <GroupList
       <GroupList
-        studioName={studioName}
         onSelect={(id) => {
         onSelect={(id) => {
           const url = `/workspace/team/${id}`;
           const url = `/workspace/team/${id}`;
           navigate(url);
           navigate(url);

+ 7 - 0
dashboard-v6/src/routes/teamRoutes.ts

@@ -6,8 +6,15 @@ import { groupLoader } from "../api/group";
 const WorkspaceTeam = lazy(() => import("../pages/workspace/team"));
 const WorkspaceTeam = lazy(() => import("../pages/workspace/team"));
 const WorkspaceTeamShow = lazy(() => import("../pages/workspace/team/show"));
 const WorkspaceTeamShow = lazy(() => import("../pages/workspace/team/show"));
 const WorkspaceTeamSetting = lazy(() => import("../pages/workspace/team/edit"));
 const WorkspaceTeamSetting = lazy(() => import("../pages/workspace/team/edit"));
+const WorkspaceMembers = lazy(() => import("../pages/workspace/members"));
 
 
 const channelRoutes: RouteObject[] = [
 const channelRoutes: RouteObject[] = [
+  // 当前团队空间的成员管理:只在团队空间里可用(见 features/teamspace/scope.ts)
+  {
+    path: "members",
+    Component: WorkspaceMembers,
+    handle: { id: "workspace.members", crumb: "members" },
+  },
   {
   {
     path: "team",
     path: "team",
     handle: { id: "workspace.team", crumb: "team" },
     handle: { id: "workspace.team", crumb: "team" },

+ 14 - 0
openapi/public/assets/protocol/main.yaml

@@ -721,6 +721,18 @@ paths:
     $ref: ./resources/auto/v3-discussions-discussion-replies.yaml
     $ref: ./resources/auto/v3-discussions-discussion-replies.yaml
   /v3/email-certifications:
   /v3/email-certifications:
     $ref: ./resources/auto/v3-email-certifications.yaml
     $ref: ./resources/auto/v3-email-certifications.yaml
+  /v3/groups:
+    $ref: ./resources/auto/v3-groups.yaml
+  '/v3/groups/{group}':
+    $ref: ./resources/auto/v3-groups-group.yaml
+  '/v3/groups/{group}/members':
+    $ref: ./resources/auto/v3-groups-group-members.yaml
+  '/v3/groups/{group}/members/{member}':
+    $ref: ./resources/auto/v3-groups-group-members-member.yaml
+  '/v3/groups/{group}/shares':
+    $ref: ./resources/auto/v3-groups-group-shares.yaml
+  '/v3/groups/{group}/shares/{share}':
+    $ref: ./resources/auto/v3-groups-group-shares-share.yaml
   /v3/heartbeat:
   /v3/heartbeat:
     $ref: ./resources/auto/v3-heartbeat.yaml
     $ref: ./resources/auto/v3-heartbeat.yaml
   /v3/invites:
   /v3/invites:
@@ -735,6 +747,8 @@ paths:
     $ref: ./resources/auto/v3-me-agent-threads-thread.yaml
     $ref: ./resources/auto/v3-me-agent-threads-thread.yaml
   '/v3/me/agent-threads/{thread}/archive':
   '/v3/me/agent-threads/{thread}/archive':
     $ref: ./resources/auto/v3-me-agent-threads-thread-archive.yaml
     $ref: ./resources/auto/v3-me-agent-threads-thread-archive.yaml
+  /v3/me/groups:
+    $ref: ./resources/auto/v3-me-groups.yaml
   /v3/me/reactions:
   /v3/me/reactions:
     $ref: ./resources/auto/v3-me-reactions.yaml
     $ref: ./resources/auto/v3-me-reactions.yaml
   '/v3/me/reactions/{reaction}':
   '/v3/me/reactions/{reaction}':

+ 17 - 0
openapi/public/assets/protocol/overrides/v2-group-group.yaml

@@ -0,0 +1,17 @@
+# 手写补充:v2 团队已被 v3 取代(2026-11-13)。
+get:
+  deprecated: true
+  description: |
+    已被 `GET /v3/groups/{group}` 取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
+put:
+  deprecated: true
+  description: |
+    已被 `PATCH /v3/groups/{group}`(局部更新,owner / manager 可改)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
+patch:
+  deprecated: true
+  description: |
+    已被 `PATCH /v3/groups/{group}`(局部更新,owner / manager 可改)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
+delete:
+  deprecated: true
+  description: |
+    已被 `DELETE /v3/groups/{group}` 取代(名下还有资源时 409)。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。

+ 14 - 0
openapi/public/assets/protocol/overrides/v2-group-member-group-member.yaml

@@ -0,0 +1,14 @@
+# 手写补充:v2 团队成员已被 v3 取代(2026-11-13)。
+put:
+  deprecated: true
+  description: |
+    空实现。改成员角色请用 `PATCH /v3/groups/{group}/members/{member}`。
+patch:
+  deprecated: true
+  description: |
+    空实现。改成员角色请用 `PATCH /v3/groups/{group}/members/{member}`。
+delete:
+  deprecated: true
+  description: |
+    已被 `DELETE /v3/groups/{group}/members/{member}` 取代(v3 允许本人退出团队)。
+    保留仅为 dashboard-v4 兼容,待 v4 下线后删除。

+ 11 - 0
openapi/public/assets/protocol/overrides/v2-group-member.yaml

@@ -0,0 +1,11 @@
+# 手写补充:v2 团队成员已被 v3 取代(2026-11-13)。
+get:
+  deprecated: true
+  description: |
+    `view=user` 已被 `GET /v3/me/groups` 取代,`view=group` 已被 `GET /v3/groups/{group}/members` 取代。
+    保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
+post:
+  deprecated: true
+  description: |
+    已被 `POST /v3/groups/{group}/members` 取代(v3 可指定角色,默认 reader)。
+    2026-11-13 起要求调用者是该团队的 owner / manager。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。

+ 5 - 0
openapi/public/assets/protocol/overrides/v2-group-my-number.yaml

@@ -0,0 +1,5 @@
+# 手写补充:v2 团队计数已被 v3 取代(2026-11-13)。
+get:
+  deprecated: true
+  description: |
+    改读 `GET /v3/me/groups?owned=true|false` 的 `meta.total`。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。

+ 11 - 0
openapi/public/assets/protocol/overrides/v2-group.yaml

@@ -0,0 +1,11 @@
+# 手写补充:v2 团队已被 v3 取代(2026-11-13)。
+get:
+  deprecated: true
+  description: |
+    `view=all` 已被 `GET /v3/groups?search=`(只搜公开团队)取代;
+    `view=studio`(含 `view2`)已被 `GET /v3/me/groups?owned=true|false` 取代。
+    保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
+post:
+  deprecated: true
+  description: |
+    已被 `POST /v3/groups` 取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。

+ 12 - 4
openapi/public/assets/protocol/resources/auto/v2-group-group.yaml

@@ -4,7 +4,8 @@ get:
   tags:
   tags:
     - group
     - group
   operationId: get_api_v2_group_group_
   operationId: get_api_v2_group_group_
-  description: 实现:`GroupController@show`
+  description: |
+    已被 `GET /v3/groups/{group}` 取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: group
       name: group
@@ -47,12 +48,14 @@ get:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true
 put:
 put:
   summary: '更新 group/{group}'
   summary: '更新 group/{group}'
   tags:
   tags:
     - group
     - group
   operationId: put_api_v2_group_group_
   operationId: put_api_v2_group_group_
-  description: 实现:`GroupController@update`
+  description: |
+    已被 `PATCH /v3/groups/{group}`(局部更新,owner / manager 可改)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: group
       name: group
@@ -91,12 +94,14 @@ put:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true
 patch:
 patch:
   summary: '更新 group/{group}'
   summary: '更新 group/{group}'
   tags:
   tags:
     - group
     - group
   operationId: patch_api_v2_group_group_
   operationId: patch_api_v2_group_group_
-  description: 实现:`GroupController@update`
+  description: |
+    已被 `PATCH /v3/groups/{group}`(局部更新,owner / manager 可改)取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: group
       name: group
@@ -135,12 +140,14 @@ patch:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true
 delete:
 delete:
   summary: '删除 group/{group}'
   summary: '删除 group/{group}'
   tags:
   tags:
     - group
     - group
   operationId: delete_api_v2_group_group_
   operationId: delete_api_v2_group_group_
-  description: 实现:`GroupController@destroy`
+  description: |
+    已被 `DELETE /v3/groups/{group}` 取代(名下还有资源时 409)。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: group
       name: group
@@ -166,3 +173,4 @@ delete:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true

+ 10 - 3
openapi/public/assets/protocol/resources/auto/v2-group-member-group-member.yaml

@@ -35,7 +35,8 @@ put:
   tags:
   tags:
     - group-member
     - group-member
   operationId: put_api_v2_group_member_group_member_
   operationId: put_api_v2_group_member_group_member_
-  description: 实现:`GroupMemberController@update`
+  description: |
+    空实现。改成员角色请用 `PATCH /v3/groups/{group}/members/{member}`。
   parameters:
   parameters:
     -
     -
       name: group_member
       name: group_member
@@ -61,12 +62,14 @@ put:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true
 patch:
 patch:
   summary: '更新 group-member/{group_member}'
   summary: '更新 group-member/{group_member}'
   tags:
   tags:
     - group-member
     - group-member
   operationId: patch_api_v2_group_member_group_member_
   operationId: patch_api_v2_group_member_group_member_
-  description: 实现:`GroupMemberController@update`
+  description: |
+    空实现。改成员角色请用 `PATCH /v3/groups/{group}/members/{member}`。
   parameters:
   parameters:
     -
     -
       name: group_member
       name: group_member
@@ -92,12 +95,15 @@ patch:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true
 delete:
 delete:
   summary: '删除 group-member/{group_member}'
   summary: '删除 group-member/{group_member}'
   tags:
   tags:
     - group-member
     - group-member
   operationId: delete_api_v2_group_member_group_member_
   operationId: delete_api_v2_group_member_group_member_
-  description: 实现:`GroupMemberController@destroy`
+  description: |
+    已被 `DELETE /v3/groups/{group}/members/{member}` 取代(v3 允许本人退出团队)。
+    保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: group_member
       name: group_member
@@ -123,3 +129,4 @@ delete:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true

+ 11 - 5
openapi/public/assets/protocol/resources/auto/v2-group-member.yaml

@@ -4,7 +4,9 @@ get:
   tags:
   tags:
     - group-member
     - group-member
   operationId: get_api_v2_group_member
   operationId: get_api_v2_group_member
-  description: 实现:`GroupMemberController@index`
+  description: |
+    `view=user` 已被 `GET /v3/me/groups` 取代,`view=group` 已被 `GET /v3/groups/{group}/members` 取代。
+    保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: view
       name: view
@@ -76,12 +78,15 @@ get:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true
 post:
 post:
-  summary: '新建 group-member'
+  summary: 往团队里加一名普通成员。
   tags:
   tags:
     - group-member
     - group-member
   operationId: post_api_v2_group_member
   operationId: post_api_v2_group_member
-  description: 实现:`GroupMemberController@store`
+  description: |
+    已被 `POST /v3/groups/{group}/members` 取代(v3 可指定角色,默认 reader)。
+    2026-11-13 起要求调用者是该团队的 owner / manager。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   requestBody:
   requestBody:
     required: true
     required: true
     content:
     content:
@@ -91,10 +96,10 @@ post:
           properties:
           properties:
             user_id:
             user_id:
               type: string
               type: string
-              description: 规则:required
+              description: '要加入的用户 uid'
             group_id:
             group_id:
               type: string
               type: string
-              description: 规则:required
+              description: '团队 uid'
           required:
           required:
             - user_id
             - user_id
             - group_id
             - group_id
@@ -139,3 +144,4 @@ post:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true

+ 3 - 1
openapi/public/assets/protocol/resources/auto/v2-group-my-number.yaml

@@ -4,7 +4,8 @@ get:
   tags:
   tags:
     - group-my-number
     - group-my-number
   operationId: get_api_v2_group_my_number
   operationId: get_api_v2_group_my_number
-  description: 实现:`GroupController@showMyNumber`
+  description: |
+    改读 `GET /v3/me/groups?owned=true|false` 的 `meta.total`。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: studio
       name: studio
@@ -29,3 +30,4 @@ get:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true

+ 8 - 2
openapi/public/assets/protocol/resources/auto/v2-group.yaml

@@ -4,7 +4,10 @@ get:
   tags:
   tags:
     - group
     - group
   operationId: get_api_v2_group
   operationId: get_api_v2_group
-  description: 实现:`GroupController@index`
+  description: |
+    `view=all` 已被 `GET /v3/groups?search=`(只搜公开团队)取代;
+    `view=studio`(含 `view2`)已被 `GET /v3/me/groups?owned=true|false` 取代。
+    保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
   parameters:
     -
     -
       name: view
       name: view
@@ -78,12 +81,14 @@ get:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true
 post:
 post:
   summary: '新建 group'
   summary: '新建 group'
   tags:
   tags:
     - group
     - group
   operationId: post_api_v2_group
   operationId: post_api_v2_group
-  description: 实现:`GroupController@store`
+  description: |
+    已被 `POST /v3/groups` 取代。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   requestBody:
   requestBody:
     required: false
     required: false
     content:
     content:
@@ -113,3 +118,4 @@ post:
       $ref: '../../main.yaml#/components/responses/Unauthorized'
       $ref: '../../main.yaml#/components/responses/Unauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ValidationError'
       $ref: '../../main.yaml#/components/responses/ValidationError'
+  deprecated: true

+ 123 - 0
openapi/public/assets/protocol/resources/auto/v3-groups-group-members-member.yaml

@@ -0,0 +1,123 @@
+# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-groups-group-members-member.yaml
+delete:
+  summary: '移除成员 / 退出团队'
+  tags:
+    - groups
+  operationId: delete_api_v3_groups_group_members_member_
+  description: |-
+    移除别人要 owner / manager;移除自己就是退出团队。owner 不能被移除、也不能退出。
+    硬删,成功返回 204 空体。
+
+    实现:`V3\GroupMemberController@destroy`
+  security:
+    -
+      bearerAuth: []
+  parameters:
+    -
+      name: group
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '团队 uid'
+    -
+      name: member
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '成员记录 id'
+  responses:
+    204:
+      description: 已移除,无响应体
+    401:
+      $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
+    403:
+      description: 不能移除这名成员
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'
+patch:
+  summary: 改成员角色
+  tags:
+    - groups
+  operationId: patch_api_v3_groups_group_members_member_
+  description: |-
+    团队的 owner / manager 才能调用;owner 那一行不能改。
+
+    实现:`V3\GroupMemberController@update`
+  security:
+    -
+      bearerAuth: []
+  parameters:
+    -
+      name: group
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '团队 uid'
+    -
+      name: member
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '成员记录 id'
+  requestBody:
+    required: false
+    content:
+      application/json:
+        schema:
+          type: object
+          properties:
+            role:
+              type: string
+              description: 角色
+              enum:
+                - manager
+                - editor
+                - reader
+  responses:
+    200:
+      description: 成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  id:
+                    type: string
+                  group_id:
+                    type: string
+                  role:
+                    type: string
+                  joined_at:
+                    type: string
+                  user:
+                    type: object
+                    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 } }
+                    nullable: true
+    401:
+      $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
+    403:
+      description: 不能管理这个团队的成员,或目标是团队拥有者
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'

+ 180 - 0
openapi/public/assets/protocol/resources/auto/v3-groups-group-members.yaml

@@ -0,0 +1,180 @@
+# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-groups-group-members.yaml
+get:
+  summary: 列出团队成员
+  tags:
+    - groups
+  operationId: get_api_v3_groups_group_members
+  description: |-
+    只有团队成员看得到。owner、manager 在前,其余按加入时间排序。
+
+    实现:`V3\GroupMemberController@index`
+  security:
+    -
+      bearerAuth: []
+  parameters:
+    -
+      name: group
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '团队 uid'
+    -
+      name: per_page
+      in: query
+      schema:
+        type: integer
+        default: 100
+      description: '每页数量,最大 200'
+    -
+      name: page
+      in: query
+      schema:
+        type: integer
+        default: 1
+      description: 页码
+  responses:
+    200:
+      description: 成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: array
+                items:
+                  type: object
+                  properties:
+                    id:
+                      type: string
+                    group_id:
+                      type: string
+                    role:
+                      type: string
+                    joined_at:
+                      type: string
+                    user:
+                      type: object
+                      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 } } }
+                      nullable: true
+              meta:
+                $ref: '../../main.yaml#/components/schemas/PaginationMeta'
+    401:
+      $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
+    403:
+      description: 不是这个团队的成员
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'
+post:
+  summary: 加一名成员
+  tags:
+    - groups
+  operationId: post_api_v3_groups_group_members
+  description: |-
+    团队的 owner / manager 才能调用。角色默认 reader(只读)。
+
+    实现:`V3\GroupMemberController@store`
+  security:
+    -
+      bearerAuth: []
+  parameters:
+    -
+      name: group
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '团队 uid'
+  requestBody:
+    required: true
+    content:
+      application/json:
+        schema:
+          type: object
+          properties:
+            user_id:
+              type: string
+              description: '要加入的用户 uuid'
+            role:
+              type: string
+              description: '角色,默认 reader'
+              enum:
+                - manager
+                - editor
+                - reader
+          required:
+            - user_id
+  responses:
+    200:
+      description: 成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  id:
+                    type: string
+                  group_id:
+                    type: string
+                  role:
+                    type: string
+                  joined_at:
+                    type: string
+                  user:
+                    type: object
+                    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 } }
+                    nullable: true
+    201:
+      description: 加入成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  id:
+                    type: string
+                  group_id:
+                    type: string
+                  role:
+                    type: string
+                  joined_at:
+                    type: string
+                  user:
+                    type: object
+                    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 } }
+                    nullable: true
+    401:
+      $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
+    403:
+      description: 不能管理这个团队的成员
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'

+ 41 - 0
openapi/public/assets/protocol/resources/auto/v3-groups-group-shares-share.yaml

@@ -0,0 +1,41 @@
+# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-groups-group-shares-share.yaml
+delete:
+  summary: 把资源移出团队
+  tags:
+    - groups
+  operationId: delete_api_v3_groups_group_shares_share_
+  description: |-
+    团队的 owner / manager,或资源的拥有者才能调用。只删这条共享,资源本身不动。
+
+    实现:`V3\GroupShareController@destroy`
+  security:
+    -
+      bearerAuth: []
+  parameters:
+    -
+      name: group
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '团队 uid'
+    -
+      name: share
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '共享记录 id'
+  responses:
+    204:
+      description: 已移出,无响应体
+    401:
+      $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
+    403:
+      description: 不能移出这项资源
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.