From 3146463771db7bbacd9fb8ca4100f7f3b841b380 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 22 Sep 2023 11:55:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E9=85=8D=E7=BD=AE=E4=B8=AD?= =?UTF-8?q?=E5=AF=B9=E7=88=B6=E7=BA=A7=E8=8A=82=E7=82=B9=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=EF=BC=8C=E4=BB=A5=E4=BF=9D=E8=AF=81=E6=9F=A5?= =?UTF-8?q?=E6=89=BE=E7=9A=84=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/node_dao.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/db/models/node_dao.go b/internal/db/models/node_dao.go index b332bced..415ddc0d 100644 --- a/internal/db/models/node_dao.go +++ b/internal/db/models/node_dao.go @@ -26,6 +26,7 @@ import ( "github.com/iwind/TeaGo/rands" "github.com/iwind/TeaGo/types" timeutil "github.com/iwind/TeaGo/utils/time" + "sort" "strconv" "strings" "time" @@ -2103,6 +2104,12 @@ func (this *NodeDAO) FindParentNodeConfigs(tx *dbs.Tx, nodeId int64, groupId int Addrs: addrStrings, SecretHash: secretHash, }) + + // 排序 + sort.Slice(parentNodeConfigs, func(i, j int) bool { + return parentNodeConfigs[i].Id < parentNodeConfigs[j].Id + }) + result[clusterId] = parentNodeConfigs } }