From 2a92ac33dd1a40f868d59a237889f96016a3013c Mon Sep 17 00:00:00 2001 From: laurencewannamaker Date: Sun, 5 Jul 2026 23:13:51 +0000 Subject: [PATCH] =?UTF-8?q?feat(org):=20org=20+members=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20--all=20=E8=87=AA=E5=8A=A8=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=EF=BC=88=E8=B5=84=E6=BA=90=E9=94=AE=20organization=5Fusers?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- doc/changes/list-all-pagination.md | 5 +++-- shortcuts/org/org.go | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/changes/list-all-pagination.md b/doc/changes/list-all-pagination.md index 7177f08..48d5a91 100644 --- a/doc/changes/list-all-pagination.md +++ b/doc/changes/list-all-pagination.md @@ -16,7 +16,7 @@ - 遵循 `total_count`:达到总数即停止;另设最大页数护栏,防止 忽略 `page` 参数的端点造成死循环。 - `PaginateAll` 保持原签名,委托给 `PaginateAllKey`。 -- 十七个分页 list 命令新增 `--all` 布尔参数(默认 false): +- 十八个分页 list 命令新增 `--all` 布尔参数(默认 false): - `issue +list --all`(合并结果同样应用 number/database_id 规范化) - `pr +list --all`、`branch +list --all`、`release +list --all` - `milestone +list --all`、`org +list --all`、`repo +list --all` @@ -24,7 +24,8 @@ - `label +list --all`、`member +list --all`、`webhook +list --all` - `issue +comments --all`(新增子命令,见下) - `tag +list --all`、`commit +list --all`(新增命令组,见下) - - `repo +watchers/+stargazers/+forks --all` + - `repo +watchers/+stargazers/+forks --all`、`org +members --all` + (资源键 `organization_users`,生产实测 gitlink 组织 71 名成员全量合并) - 对应资源键:`issues`/`pulls`/`branches`/`releases`/`milestones`/ `organizations`/`projects`/`users`/`issue_tags`/`collaborators`/`webhooks` (均生产实测确认) diff --git a/shortcuts/org/org.go b/shortcuts/org/org.go index bdd244b..cf27900 100644 --- a/shortcuts/org/org.go +++ b/shortcuts/org/org.go @@ -59,12 +59,20 @@ func Shortcuts(translators ...*i18n.Translator) []*common.Shortcut { {Name: "id", Short: "i", Usage: tr.T("flag.org.id"), Required: true}, {Name: "page", Short: "p", Usage: tr.T("flag.page"), Default: "1"}, {Name: "limit", Short: "l", Usage: tr.T("flag.limit"), Default: "20"}, + {Name: "all", Usage: tr.T("flag.all"), Bool: true, Default: "false"}, }, Run: func(ctx *common.RuntimeContext) error { id, _ := ctx.RequireArg("id") q := url.Values{} q.Set("page", ctx.Arg("page")) q.Set("limit", ctx.Arg("limit")) + if ctx.Arg("all") == "true" { + items, err := ctx.PaginateAllKey(fmt.Sprintf("/organizations/%s/organization_users", id), q, "organization_users") + if err != nil { + return err + } + return ctx.Output(common.NewListEnvelope("organization_users", items)) + } env, err := ctx.CallAPIWithQuery("GET", fmt.Sprintf("/organizations/%s/organization_users", id), q) if err != nil { return err