[feat]网关子设备,直接上传,自动创建设备模型,无需手动创建

This commit is contained in:
PandaX
2023-10-17 11:14:18 +08:00
parent f26c5a2647
commit 55e399e5cb
23 changed files with 1457 additions and 74 deletions

View File

@@ -11,14 +11,16 @@ import (
// DeviceGroup 设备分组
type DeviceGroup struct {
global_model.BaseAuthModel
Name string `json:"name" gorm:"type:varchar(128);comment:设备分组名称" validate:"required"`
Pid string `json:"pid" gorm:"type:varchar(64);comment:设备分组类型"`
Path string `json:"path" gorm:"type:varchar(255);comment:设备分组路径"`
Description string `json:"description" gorm:"type:varchar(255);comment:设备分组说明"`
Sort int64 `json:"sort" gorm:"type:int;comment:排序"`
Status string `gorm:"status;type:varchar(1);comment:状态" json:"status"`
Ext Ext `json:"ext" gorm:"type:json;comment:扩展"` //可扩展的kv map,承载设备组的外围信息
Children []DeviceGroup `json:"children" gorm:"-"` //子节点
Name string `json:"name" gorm:"type:varchar(128);comment:设备分组名称" validate:"required"`
Pid string `json:"pid" gorm:"type:varchar(64);comment:设备分组类型"`
Path string `json:"path" gorm:"type:varchar(255);comment:设备分组路径"`
Description string `json:"description" gorm:"type:varchar(255);comment:设备分组说明"`
Sort int64 `json:"sort" gorm:"type:int;comment:排序"`
Status string `gorm:"type:varchar(1);comment:状态" json:"status"`
Ext Ext `json:"ext" gorm:"type:json;comment:扩展"` //可扩展的kv map,承载设备组的外围信息
IsDefault string `gorm:"type:varchar(1);comment:是否默认" json:"isDefault"`
Children []DeviceGroup `json:"children" gorm:"-"` //子节点
RoleId int64 `gorm:"-"` // 角色数据权限
}