Commit 578223ad authored by AfirSraftGarrier's avatar AfirSraftGarrier

修改

parent 703116b2
......@@ -92,10 +92,9 @@ public class OperateController {
@GetMapping("alarm/list")
@MyLog(title = "获取告警列表", businessType = BusinessType.SELECT)
public ResResult<List<AlarmVo>> getAlarmList() {
String userId = UserUtils.getLoginUserId();
String comeId = ESAPI.encoder().encodeForHTML(userId);
int Id = Integer.valueOf(comeId);
List<AlarmVo> alarmList = alarmService.getAlarmList(Id);
String user = UserUtils.getLoginUserId();
int userI = Integer.valueOf(user);
List<AlarmVo> alarmList = alarmService.getAlarmList(userI);
return ResResult.success().goRecord(alarmList);
}
......
......@@ -25,11 +25,11 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements
}
@Override
public List<AlarmVo> getAlarmList(int userId) {
if (userId == 0) {
public List<AlarmVo> getAlarmList(int uI) {
if (uI == 0) {
throw new IotLicenseException(ResultCode.VALIDATE_FAILED.getCode(), ResultCode.VALIDATE_FAILED.getMsg());
}
List<AlarmVo> alarmVos = alarmMapper.getAlarmList(userId);
List<AlarmVo> alarmVos = alarmMapper.getAlarmList(uI);
alarmVos = alarmVos.stream().sorted(Comparator.comparing(AlarmVo::getCreateTime, Comparator.reverseOrder())).collect(Collectors.toList());
return alarmVos;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment