【feature】添加组织数据读取权限

This commit is contained in:
XM-GO
2023-09-14 17:28:52 +08:00
parent bde42bfc9a
commit b5ee2a54b9
84 changed files with 1664 additions and 774 deletions

View File

@@ -19,6 +19,8 @@ type DeviceGroup struct {
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:"-"` //子节点
RoleId int64 `gorm:"-"` // 角色数据权限
}
type DeviceGroupLabel struct {
@@ -42,7 +44,10 @@ type Device struct {
LastAt time.Time `gorm:"column:last_time;comment:最后一次在线时间" json:"lastTime"`
OtaVersion string `json:"otaVersion" gorm:"type:varchar(64);comment:固件版本" ` //上一次固件升级的版本
Ext Ext `json:"ext" gorm:"type:json;comment:扩展"` //可扩展的kv map,承载设备组的外围信息
RoleId int64 `gorm:"-"` // 角色数据权限
}
type DeviceRes struct {
Device
DeviceGroup DeviceGroup `json:"deviceGroup" gorm:"foreignKey:Gid;references:Id"`

View File

@@ -9,6 +9,7 @@ import "time"
// DeviceAlarm 设备告警表 需要更改告警状态不能存在时序数据库中
type DeviceAlarm struct {
Id string `json:"id" gorm:"primary_key;"`
OrgId int64 `json:"orgId" gorm:"type:int;comment:机构ID"`
Time time.Time `gorm:"comment:告警时间" json:"time"`
Name string `gorm:"type:varchar(64);comment:告警名称" json:"name"`
DeviceId string `gorm:"type:varchar(64);comment:所属设备" json:"deviceId"`
@@ -17,6 +18,8 @@ type DeviceAlarm struct {
Level string `gorm:"type:varchar(64);comment:告警级别" json:"level"` // 危险 重要 次要 警告 不确定
State string `gorm:"type:varchar(1);comment:告警状态" json:"state"` // 告警中 0 已确认 1 已清除 2 已关闭 3
Details string `gorm:"type:varchar(255);comment:告警详情" json:"details"`
RoleId int64 `gorm:"-"` // 角色数据权限
}
type DeviceAlarmForm struct {

View File

@@ -49,6 +49,8 @@ type Product struct {
SelfLearn bool `json:"selfLearn" gorm:"default:0;comment:自学习开关"`
RuleChainId string `json:"ruleChainId" gorm:"type:varchar(64);comment:规则链Id"` //可空,如果空就走根规则链
Status string `gorm:"status;type:varchar(1);comment:状态" json:"status"`
RoleId int64 `gorm:"-"` // 角色数据权限
}
type ProductRes struct {