告警信息查询 确认接口新增

This commit is contained in:
huguanghan 2024-11-05 15:01:15 +08:00
parent 79eac71645
commit 49f086bc19
3 changed files with 10 additions and 8 deletions

View File

@ -46,8 +46,8 @@ public class EventController {
* @param deviceEventInfo 确认信息
*/
@PostMapping("/confirm")
public R<Void> confirmEvent(@RequestBody DeviceEventInfo deviceEventInfo){
eventService.confirmEvent(deviceEventInfo);
public R<Void> confirmEvent(@RequestBody List<DeviceEventInfo> deviceEventInfoList){
eventService.confirmEvent(deviceEventInfoList);
return R.success();
}
}

View File

@ -9,5 +9,5 @@ import java.util.List;
public interface EventService {
List<DeviceEventInfo> queryEvent(EventQueryParam param);
void confirmEvent(DeviceEventInfo deviceEventInfo);
void confirmEvent(List<DeviceEventInfo> deviceEventInfoList);
}

View File

@ -31,11 +31,13 @@ public class EventServiceImpl implements EventService {
}
@Override
public void confirmEvent(DeviceEventInfo deviceEventInfo) {
public void confirmEvent(List<DeviceEventInfo> deviceEventInfoList) {
Long confirmTime = System.currentTimeMillis();
deviceEventInfo.setConfirmTime(confirmTime);
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
deviceEventInfo.setConfirmAccount(sysUserVo.getAccount());
tdEngineService.confirmEvent(deviceEventInfo);
for (DeviceEventInfo deviceEventInfo : deviceEventInfoList){
deviceEventInfo.setConfirmTime(confirmTime);
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
deviceEventInfo.setConfirmAccount(sysUserVo.getAccount());
tdEngineService.confirmEvent(deviceEventInfo);
}
}
}