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