规则链审计日志

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)
}

View File

@@ -16,13 +16,15 @@ type DeviceAlarmApi struct {
// GetDeviceAlarmList 告警列表数据
func (p *DeviceAlarmApi) GetDeviceAlarmList(rc *restfulx.ReqCtx) {
data := entity.DeviceAlarm{}
data := entity.DeviceAlarmForm{}
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
data.DeviceId = restfulx.QueryParam(rc, "deviceId")
data.Type = restfulx.QueryParam(rc, "type")
data.Level = restfulx.QueryParam(rc, "level")
data.State = restfulx.QueryParam(rc, "state")
data.StartTime = restfulx.QueryParam(rc, "startTime")
data.EndTime = restfulx.QueryParam(rc, "endTime")
list, total := p.DeviceAlarmApp.FindListPage(pageNum, pageSize, data)

View File

@@ -70,10 +70,8 @@ func (p *ProductApi) InsertProduct(rc *restfulx.ReqCtx) {
data.Id = kgo.KStr.Uniqid("p_")
data.Owner = rc.LoginAccount.UserName
p.ProductApp.Insert(data)
// 创建taos数据库超级表 摄像头产品不创建
if data.DeviceType != global.MONITOR {
createDeviceStable(data.Id)
}
// 创建taos数据库超级表
createDeviceStable(data.Id)
}
// UpdateProduct 修改Product