Commit f141050ace7b930138801b5dd73b383105ee9588
1 parent
3a6aca85
perf: 只需要角色权限控制的统一使用hasAnyAuthority
Showing
1 changed file
with
6 additions
and
6 deletions
@@ -397,7 +397,7 @@ public class TkDeviceController extends BaseController { | @@ -397,7 +397,7 @@ public class TkDeviceController extends BaseController { | ||
397 | } | 397 | } |
398 | 398 | ||
399 | @GetMapping("/list") | 399 | @GetMapping("/list") |
400 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 400 | + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN','CUSTOMER_USER')") |
401 | @ApiOperation("获取满足条件的所有设备") | 401 | @ApiOperation("获取满足条件的所有设备") |
402 | public List<DeviceDTO> getDevices( | 402 | public List<DeviceDTO> getDevices( |
403 | @ApiParam(value = "设备类型") @RequestParam(value = "deviceType", required = false) | 403 | @ApiParam(value = "设备类型") @RequestParam(value = "deviceType", required = false) |
@@ -421,7 +421,7 @@ public class TkDeviceController extends BaseController { | @@ -421,7 +421,7 @@ public class TkDeviceController extends BaseController { | ||
421 | 421 | ||
422 | 422 | ||
423 | @PostMapping("/getListByDeviceProfileIds") | 423 | @PostMapping("/getListByDeviceProfileIds") |
424 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 424 | + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN','CUSTOMER_USER')") |
425 | @ApiOperation("获取多种产品下的设备") | 425 | @ApiOperation("获取多种产品下的设备") |
426 | public List<DeviceDTO> getListByDeviceProfileIds( | 426 | public List<DeviceDTO> getListByDeviceProfileIds( |
427 | @RequestBody (required = false)List<String> deviceProfileIds, | 427 | @RequestBody (required = false)List<String> deviceProfileIds, |
@@ -437,7 +437,7 @@ public class TkDeviceController extends BaseController { | @@ -437,7 +437,7 @@ public class TkDeviceController extends BaseController { | ||
437 | } | 437 | } |
438 | 438 | ||
439 | @GetMapping("/gateway/list") | 439 | @GetMapping("/gateway/list") |
440 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 440 | + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN','CUSTOMER_USER')") |
441 | @ApiOperation("获取满足条件的所有设备") | 441 | @ApiOperation("获取满足条件的所有设备") |
442 | public List<DeviceDTO> getGatewayDevices( | 442 | public List<DeviceDTO> getGatewayDevices( |
443 | @ApiParam(value = "组织ID") | 443 | @ApiParam(value = "组织ID") |
@@ -454,7 +454,7 @@ public class TkDeviceController extends BaseController { | @@ -454,7 +454,7 @@ public class TkDeviceController extends BaseController { | ||
454 | } | 454 | } |
455 | 455 | ||
456 | @GetMapping("/list/master/{organizationId}") | 456 | @GetMapping("/list/master/{organizationId}") |
457 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 457 | + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN','CUSTOMER_USER')") |
458 | @ApiOperation("主设备列表") | 458 | @ApiOperation("主设备列表") |
459 | public List<SelectItemDTO> getMasterDevices( | 459 | public List<SelectItemDTO> getMasterDevices( |
460 | @ApiParam(value = "组织ID") @PathVariable("organizationId") String organizationId, | 460 | @ApiParam(value = "组织ID") @PathVariable("organizationId") String organizationId, |
@@ -469,7 +469,7 @@ public class TkDeviceController extends BaseController { | @@ -469,7 +469,7 @@ public class TkDeviceController extends BaseController { | ||
469 | } | 469 | } |
470 | 470 | ||
471 | @GetMapping("/list/slave/{organizationId}") | 471 | @GetMapping("/list/slave/{organizationId}") |
472 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 472 | + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN','CUSTOMER_USER')") |
473 | @ApiOperation("从设备列表") | 473 | @ApiOperation("从设备列表") |
474 | public List<SelectItemDTO> getSlaveDevices( | 474 | public List<SelectItemDTO> getSlaveDevices( |
475 | @ApiParam(value = "组织ID") @PathVariable("organizationId") String organizationId, | 475 | @ApiParam(value = "组织ID") @PathVariable("organizationId") String organizationId, |
@@ -484,7 +484,7 @@ public class TkDeviceController extends BaseController { | @@ -484,7 +484,7 @@ public class TkDeviceController extends BaseController { | ||
484 | } | 484 | } |
485 | 485 | ||
486 | @GetMapping("/keys/{organizationId}") | 486 | @GetMapping("/keys/{organizationId}") |
487 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 487 | + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN','CUSTOMER_USER')") |
488 | @ApiOperation("设备遥测指标名称") | 488 | @ApiOperation("设备遥测指标名称") |
489 | public List<String> listKeys( | 489 | public List<String> listKeys( |
490 | @ApiParam(value = "组织ID") @PathVariable("organizationId") String organizationId, | 490 | @ApiParam(value = "组织ID") @PathVariable("organizationId") String organizationId, |