|
|
|
@ -44,7 +44,7 @@ import java.util.stream.Collectors; |
|
|
|
@RequestMapping("/api") |
|
|
|
public class AlarmController extends BaseController { |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/alarm/{alarmId}", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public Alarm getAlarmById(@PathVariable("alarmId") String strAlarmId) throws ThingsboardException { |
|
|
|
@ -57,7 +57,7 @@ public class AlarmController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/alarm/info/{alarmId}", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public AlarmInfo getAlarmInfoById(@PathVariable("alarmId") String strAlarmId) throws ThingsboardException { |
|
|
|
@ -70,7 +70,7 @@ public class AlarmController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/alarm", method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
public Alarm saveAlarm(@RequestBody Alarm alarm) throws ThingsboardException { |
|
|
|
@ -82,7 +82,7 @@ public class AlarmController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/alarm/{alarmId}/ack", method = RequestMethod.POST) |
|
|
|
@ResponseStatus(value = HttpStatus.OK) |
|
|
|
public void ackAlarm(@PathVariable("alarmId") String strAlarmId) throws ThingsboardException { |
|
|
|
@ -96,7 +96,7 @@ public class AlarmController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/alarm/{alarmId}/clear", method = RequestMethod.POST) |
|
|
|
@ResponseStatus(value = HttpStatus.OK) |
|
|
|
public void clearAlarm(@PathVariable("alarmId") String strAlarmId) throws ThingsboardException { |
|
|
|
@ -110,7 +110,7 @@ public class AlarmController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/alarm/{entityType}/{entityId}", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public TimePageData<AlarmInfo> getAlarms( |
|
|
|
@ -143,7 +143,7 @@ public class AlarmController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/alarm/highestSeverity/{entityType}/{entityId}", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public AlarmSeverity getHighestAlarmSeverity( |
|
|
|
|