规则链审计日志

This commit is contained in:
XM-GO
2023-09-06 17:24:02 +08:00
parent 876a19adfe
commit 3c645e7529
18 changed files with 94 additions and 228 deletions

View File

@@ -124,10 +124,8 @@ func (p *DeviceApi) InsertDevice(rc *restfulx.ReqCtx) {
data.LinkStatus = global.INACTIVE
data.LastAt = time.Now()
p.DeviceApp.Insert(data)
// 视频设备不创建超级表
if data.DeviceType != global.MONITOR {
createDeviceTable(data.Pid, data.Name)
}
// 创建超级表
createDeviceTable(data.Pid, data.Name)
}
// UpdateDevice 修改Device
@@ -145,9 +143,7 @@ func (p *DeviceApi) DeleteDevice(rc *restfulx.ReqCtx) {
for _, id := range ids {
list := p.DeviceApp.FindOne(id)
// 删除表
if list.DeviceType != global.MONITOR {
deleteDeviceTable(list.Name)
}
deleteDeviceTable(list.Name)
}
p.DeviceApp.Delete(ids)
}