Showing
3 changed files
with
11 additions
and
8 deletions
... | ... | @@ -26,14 +26,13 @@ public class YtAppDesignController extends BaseController { |
26 | 26 | |
27 | 27 | @GetMapping("get") |
28 | 28 | @ApiOperation("查询详情") |
29 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:appDesign:get:get'})") | |
30 | 29 | public ResponseEntity<SysAppDesignDTO> get() throws ThingsboardException { |
31 | 30 | return ResponseEntity.ok(sysAppDesignService.get(getCurrentUser().getCurrentTenantId())); |
32 | 31 | } |
33 | 32 | |
34 | 33 | @PutMapping("update") |
35 | 34 | @ApiOperation("更新") |
36 | - @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:appDesign:update:update'})") | |
35 | + @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','TENANT_ADMIN'},{'api:yt:appDesign:update:update'})") | |
37 | 36 | public ResponseEntity update(@RequestBody SysAppDesignDTO sysAppDesignDTO) |
38 | 37 | throws ThingsboardException { |
39 | 38 | sysAppDesignDTO.setId(null); | ... | ... |
... | ... | @@ -25,14 +25,13 @@ public class YtEnterpriseController extends BaseController { |
25 | 25 | private final SysEnterpriseService sysEnterpriseService; |
26 | 26 | |
27 | 27 | @GetMapping("get") |
28 | - @PreAuthorize("@check.checkPermissions({},{'api:yt:enterprise:get:get'})") | |
29 | 28 | @ApiOperation("查询详情") |
30 | 29 | public ResponseEntity<SysEnterpriseDTO> get() throws ThingsboardException { |
31 | 30 | return ResponseEntity.ok(sysEnterpriseService.get(getCurrentUser().getCurrentTenantId())); |
32 | 31 | } |
33 | 32 | |
34 | 33 | @PutMapping("update") |
35 | - @PreAuthorize("@check.checkPermissions({},{'api:yt:enterprise:update:update'})") | |
34 | + @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','TENANT_ADMIN'},{'api:yt:enterprise:update:update'})") | |
36 | 35 | @ApiOperation("更新") |
37 | 36 | public ResponseEntity<Boolean> update(@RequestBody SysEnterpriseDTO sysEnterpriseDTO) |
38 | 37 | throws ThingsboardException { | ... | ... |
... | ... | @@ -7,6 +7,7 @@ import org.springframework.http.ResponseEntity; |
7 | 7 | import org.springframework.security.access.prepost.PreAuthorize; |
8 | 8 | import org.springframework.web.bind.annotation.*; |
9 | 9 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
10 | +import org.thingsboard.server.common.data.id.EntityId; | |
10 | 11 | import org.thingsboard.server.common.data.yunteng.dto.SysPlatformDesignDTO; |
11 | 12 | import org.thingsboard.server.controller.BaseController; |
12 | 13 | import org.thingsboard.server.dao.yunteng.service.SysPlatformDesignService; |
... | ... | @@ -25,14 +26,18 @@ public class YtPlatformDesignController extends BaseController { |
25 | 26 | private final SysPlatformDesignService sysPlatformDesignService; |
26 | 27 | |
27 | 28 | @GetMapping("get") |
28 | - @PreAuthorize("@check.checkPermissions({},{'api:yt:platform:get:get'})") | |
29 | 29 | @ApiOperation("查询详情") |
30 | - public ResponseEntity<SysPlatformDesignDTO> get() throws ThingsboardException { | |
31 | - return ResponseEntity.ok(sysPlatformDesignService.get(getCurrentUser().getCurrentTenantId())); | |
30 | + public ResponseEntity<SysPlatformDesignDTO> get() { | |
31 | + String tenantId = EntityId.NULL_UUID.toString(); | |
32 | + try { | |
33 | + tenantId = getCurrentUser().getCurrentTenantId(); | |
34 | + } catch (ThingsboardException e) { | |
35 | + } | |
36 | + return ResponseEntity.ok(sysPlatformDesignService.get(tenantId)); | |
32 | 37 | } |
33 | 38 | |
34 | 39 | @PutMapping("update") |
35 | - @PreAuthorize("@check.checkPermissions({},{'api:yt:platform:update:update'})") | |
40 | + @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','TENANT_ADMIN'},{'api:yt:platform:update:update'})") | |
36 | 41 | @ApiOperation("更新") |
37 | 42 | public ResponseEntity update(@RequestBody SysPlatformDesignDTO sysPlatformDesignDTO) |
38 | 43 | throws ThingsboardException { | ... | ... |