package model import "fmt" // ============================ // 公共类型 — 全包共用,唯一来源 // ============================ // Device 设备(MAC 为唯一标识) // 当前仅 IP/MAC 两个字段,后续按需扩展 type Device struct { IP string // 当前 IP(DHCP 可能变化) MAC string // 物理地址,唯一标识,空 = 无法获取 } // Label 设备显示名(用于日志/报告) func (d Device) Label() string { return fmt.Sprintf("%s (%s)", d.MAC, d.IP) }