简单实现DeviceRepository

This commit is contained in:
2025-09-12 16:28:28 +08:00
parent fe25800a42
commit d09fb815bb
2 changed files with 98 additions and 3 deletions

View File

@@ -60,9 +60,6 @@ type Device struct {
// Name 是设备的业务名称,应清晰可读,例如 "1号猪舍温度传感器" 或 "做料车间主控"
Name string `gorm:"not null" json:"name"`
// DeviceCode 是设备的唯一出厂编码或序列号,用于在系统中唯一标识一个物理设备
DeviceCode string `gorm:"unique;not null" json:"device_code"`
// Type 是设备的高级类别,用于区分区域主控和普通设备。建立索引以优化按类型查询。
Type DeviceType `gorm:"not null;index" json:"type"`