From b59eea4391c848406ee4aee5a30e76160dabfc18 Mon Sep 17 00:00:00 2001 From: logan Date: Mon, 25 May 2026 23:50:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ListInstanceGroups=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=20enriched=20=E6=95=B0=E6=8D=AE=E5=90=AB=20instance=20IDs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ListInstanceGroups 改用 enrichGroup 返回完整数据 - 包含 readonly_instance_ids/write_instance_ids 供前端穿梭框回显 --- backend/go.mod | 3 +++ backend/internal/handler/ghost.go | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/go.mod b/backend/go.mod index 5062546..00112cb 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -16,6 +16,7 @@ require ( github.com/Azure/go-ntlmssp v0.1.0 // indirect github.com/bytedance/sonic v1.13.2 // indirect github.com/bytedance/sonic/loader v0.2.4 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudwego/base64x v0.1.5 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect github.com/gin-contrib/sse v1.0.0 // indirect @@ -37,8 +38,10 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/redis/go-redis/v9 v9.19.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect + go.uber.org/atomic v1.11.0 // indirect golang.org/x/arch v0.15.0 // indirect golang.org/x/net v0.50.0 // indirect golang.org/x/sys v0.41.0 // indirect diff --git a/backend/internal/handler/ghost.go b/backend/internal/handler/ghost.go index 0bb10ff..4f6f523 100644 --- a/backend/internal/handler/ghost.go +++ b/backend/internal/handler/ghost.go @@ -165,7 +165,11 @@ func ListWorkflows(c *gin.Context) { func ListInstanceGroups(c *gin.Context) { var groups []model.InstanceGroup model.DB.Order("id").Find(&groups) - c.JSON(http.StatusOK, groups) + result := make([]gin.H, len(groups)) + for i, g := range groups { + result[i] = enrichGroup(g) + } + c.JSON(http.StatusOK, result) } // POST /api/v1/notifications/test