增加任务设备关联表
This commit is contained in:
@@ -77,6 +77,9 @@ type Device struct {
|
||||
// Properties 用于存储特定类型设备的独有属性,采用JSON格式。
|
||||
// 建议在应用层为不同子类型的设备定义专用的属性结构体,以保证数据一致性。
|
||||
Properties datatypes.JSON `json:"properties"`
|
||||
|
||||
// Tasks 是与此设备关联的任务列表,通过 DeviceTask 关联表实现多对多关系
|
||||
Tasks []Task `gorm:"many2many:device_tasks;" json:"tasks"`
|
||||
}
|
||||
|
||||
// SelfCheck 对 Device 的关键字段和属性进行业务逻辑验证。
|
||||
|
||||
Reference in New Issue
Block a user