补充测试用例

This commit is contained in:
2025-09-13 19:48:13 +08:00
parent ec2595a751
commit bd22e452d3
9 changed files with 353 additions and 117 deletions

View File

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