Commit 02fc7ddbf59ae8192c3570994057f5427154d1f7
Merge branch 'tianfu' into 'master'
fix: 修改bug,关于大屏设计器 See merge request yunteng/thingskit!166
Showing
2 changed files
with
9 additions
and
10 deletions
application/src/main/java/org/thingsboard/server/controller/yunteng/TkDataViewContentController.java
@@ -4,7 +4,6 @@ import io.swagger.annotations.Api; | @@ -4,7 +4,6 @@ import io.swagger.annotations.Api; | ||
4 | import io.swagger.annotations.ApiOperation; | 4 | import io.swagger.annotations.ApiOperation; |
5 | import lombok.RequiredArgsConstructor; | 5 | import lombok.RequiredArgsConstructor; |
6 | import org.springframework.http.ResponseEntity; | 6 | import org.springframework.http.ResponseEntity; |
7 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
8 | import org.springframework.validation.annotation.Validated; | 7 | import org.springframework.validation.annotation.Validated; |
9 | import org.springframework.web.bind.annotation.*; | 8 | import org.springframework.web.bind.annotation.*; |
10 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 9 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
@@ -17,19 +16,19 @@ import org.thingsboard.server.common.data.yunteng.dto.request.TkDataViewContentI | @@ -17,19 +16,19 @@ import org.thingsboard.server.common.data.yunteng.dto.request.TkDataViewContentI | ||
17 | import org.thingsboard.server.controller.BaseController; | 16 | import org.thingsboard.server.controller.BaseController; |
18 | import org.thingsboard.server.dao.yunteng.service.TkDataViewContentService; | 17 | import org.thingsboard.server.dao.yunteng.service.TkDataViewContentService; |
19 | 18 | ||
19 | +/** | ||
20 | + * @author tianfuLei | ||
21 | + */ | ||
20 | @RestController | 22 | @RestController |
21 | @RequestMapping("/api/yt/data_view/content") | 23 | @RequestMapping("/api/yt/data_view/content") |
22 | @RequiredArgsConstructor | 24 | @RequiredArgsConstructor |
23 | @Api(tags = "大屏内容") | 25 | @Api(tags = "大屏内容") |
24 | -@PreAuthorize("@check.checkPermissions('TENANT_ADMIN','CUSTOMER_USER')") | ||
25 | public class TkDataViewContentController extends BaseController { | 26 | public class TkDataViewContentController extends BaseController { |
26 | 27 | ||
27 | private final TkDataViewContentService tkDataViewContentService; | 28 | private final TkDataViewContentService tkDataViewContentService; |
28 | 29 | ||
29 | @PostMapping | 30 | @PostMapping |
30 | @ApiOperation("新增") | 31 | @ApiOperation("新增") |
31 | - @PreAuthorize( | ||
32 | - "@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:dataview:content:post'})") | ||
33 | public ResponseEntity<TkDataViewContentDTO> save( | 32 | public ResponseEntity<TkDataViewContentDTO> save( |
34 | @Validated({AddGroup.class}) @RequestBody TkDataViewContentDTO tkDataViewContentDTO) | 33 | @Validated({AddGroup.class}) @RequestBody TkDataViewContentDTO tkDataViewContentDTO) |
35 | throws ThingsboardException { | 34 | throws ThingsboardException { |
@@ -40,8 +39,6 @@ public class TkDataViewContentController extends BaseController { | @@ -40,8 +39,6 @@ public class TkDataViewContentController extends BaseController { | ||
40 | 39 | ||
41 | @PutMapping | 40 | @PutMapping |
42 | @ApiOperation("修改") | 41 | @ApiOperation("修改") |
43 | - @PreAuthorize( | ||
44 | - "@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:dataview:content:update'})") | ||
45 | public ResponseEntity<TkDataViewContentInfoDTO> update( | 42 | public ResponseEntity<TkDataViewContentInfoDTO> update( |
46 | @Validated({UpdateGroup.class}) @RequestBody TkDataViewContentInfoDTO contentReqDTO) | 43 | @Validated({UpdateGroup.class}) @RequestBody TkDataViewContentInfoDTO contentReqDTO) |
47 | throws ThingsboardException { | 44 | throws ThingsboardException { |
@@ -55,8 +52,6 @@ public class TkDataViewContentController extends BaseController { | @@ -55,8 +52,6 @@ public class TkDataViewContentController extends BaseController { | ||
55 | 52 | ||
56 | @DeleteMapping | 53 | @DeleteMapping |
57 | @ApiOperation("删除") | 54 | @ApiOperation("删除") |
58 | - @PreAuthorize( | ||
59 | - "@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:dataview:content:delete'})") | ||
60 | public ResponseEntity<Boolean> delete( | 55 | public ResponseEntity<Boolean> delete( |
61 | @Validated({DeleteGroup.class}) @RequestBody DeleteDTO deleteDTO) | 56 | @Validated({DeleteGroup.class}) @RequestBody DeleteDTO deleteDTO) |
62 | throws ThingsboardException { | 57 | throws ThingsboardException { |
@@ -24,11 +24,14 @@ import java.util.HashMap; | @@ -24,11 +24,14 @@ import java.util.HashMap; | ||
24 | 24 | ||
25 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*; | 25 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*; |
26 | 26 | ||
27 | +/** | ||
28 | + * @author tianfuLei | ||
29 | + */ | ||
27 | @RestController | 30 | @RestController |
28 | @RequestMapping("/api/yt/data_view") | 31 | @RequestMapping("/api/yt/data_view") |
29 | @RequiredArgsConstructor | 32 | @RequiredArgsConstructor |
30 | @Api(tags = "大屏设计器") | 33 | @Api(tags = "大屏设计器") |
31 | -@PreAuthorize("@check.checkPermissions('TENANT_ADMIN','CUSTOMER_USER')") | 34 | +@PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
32 | public class TkDataViewController extends BaseController { | 35 | public class TkDataViewController extends BaseController { |
33 | 36 | ||
34 | private final TkDataViewService tkDataViewService; | 37 | private final TkDataViewService tkDataViewService; |
@@ -103,7 +106,8 @@ public class TkDataViewController extends BaseController { | @@ -103,7 +106,8 @@ public class TkDataViewController extends BaseController { | ||
103 | 106 | ||
104 | @GetMapping("/get_configuration_info/{id}") | 107 | @GetMapping("/get_configuration_info/{id}") |
105 | @ApiOperation("获取大屏信息") | 108 | @ApiOperation("获取大屏信息") |
106 | -// @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:dataview:center:get_configuration_info:get'})") | 109 | + @PreAuthorize( |
110 | + "@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:dataview:center:get_dataview_info:design','api:yt:dataview:center:get_dataview_info:preview'})") | ||
107 | public ResponseEntity<TkDataViewContentInfoDTO> getConfigurationInfos( | 111 | public ResponseEntity<TkDataViewContentInfoDTO> getConfigurationInfos( |
108 | @PathVariable("id") String id) throws ThingsboardException { | 112 | @PathVariable("id") String id) throws ThingsboardException { |
109 | return ResponseEntity.ok( | 113 | return ResponseEntity.ok( |