From a2505cfe4425994e7eb0dc19bcef8fc0c38baf2b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 26 Apr 2026 01:24:00 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E7=BB=9F=E4=B8=80=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=9C=AF=E8=AF=AD=E5=B9=B6=E6=B8=85=E7=90=86=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - database -> storage - 移除重复的Neighbor注释 --- cmd/main.go | 2 +- pkg/models/models.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 376f0d2..a6d08e9 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -50,7 +50,7 @@ func NewApp(cfg *config.Config) *App { if err != nil { log.Printf("Warning: failed to load devices from database: %v", err) } else { - log.Printf("Loaded %d devices from database", len(devices)) + log.Printf("Loaded %d devices from storage", len(devices)) for _, dev := range devices { app.builder.AddDevice(dev) } diff --git a/pkg/models/models.go b/pkg/models/models.go index ce5a1f9..fa77aa4 100644 --- a/pkg/models/models.go +++ b/pkg/models/models.go @@ -47,13 +47,12 @@ type Interface struct { OutPackets int64 `json:"out_packets"` } -// Neighbor 邻居设备信息 // Neighbor 邻居设备信息 type Neighbor struct { LocalInterface string `json:"local_interface"` RemoteDevice string `json:"remote_device"` RemoteIP string `json:"remote_ip"` - RemoteMAC string `json:"remote_mac,omitempty"` // 新增:邻居MAC地址 + RemoteMAC string `json:"remote_mac,omitempty"` // MAC地址(用于拓扑匹配) RemoteInterface string `json:"remote_interface"` Protocol string `json:"protocol"` // CDP, LLDP, ARP }