修复bug

This commit is contained in:
2025-09-20 17:11:04 +08:00
parent cb63437e0e
commit 1f2d54d53e
9 changed files with 212 additions and 104 deletions

View File

@@ -70,7 +70,7 @@ type Device struct {
gorm.Model
// Name 是设备的业务名称,应清晰可读,例如 "1号猪舍温度传感器" 或 "做料车间主控"
Name string `gorm:"unique;not null" json:"name"`
Name string `gorm:"not null" json:"name"`
// Type 是设备的高级类别,用于区分区域主控和普通设备。建立索引以优化按类型查询。
Type DeviceType `gorm:"not null;index" json:"type"`