Fix: 修复存储文件名和拓扑构建逻辑

- 修正存储文件名: network-topology.db -> devices.json
- 移除handleGetDevices中的重复builder重建逻辑
- 移除冗余的调试日志输出
- 统一日志术语: database -> storage
- 确保添加设备时正确更新builder和存储
这个提交包含在:
Your Name
2026-04-26 00:57:24 +08:00
父节点 30b05709eb
当前提交 872ebc0376
修改 2 个文件,包含 8 行新增24 行删除
-9
查看文件
@@ -50,15 +50,6 @@ func (b *Builder) Build() models.TopologyGraph {
}
nodeMap[device.IP] = node
graph.Nodes = append(graph.Nodes, node)
// 调试信息
fmt.Printf("Node added: %s (%s) with %d neighbors\n",
device.IP, device.Type, len(device.Neighbors))
for i, neighbor := range device.Neighbors {
fmt.Printf(" Neighbor %d: RemoteIP=%s, RemoteDevice=%s, LocalIf=%s, RemoteIf=%s\n",
i+1, neighbor.RemoteIP, neighbor.RemoteDevice,
neighbor.LocalInterface, neighbor.RemoteInterface)
}
}
// 构建边(基于邻居信息)