Commit 02fc7ddbf59ae8192c3570994057f5427154d1f7

Authored by xp.Huang
2 parents 7564c478 d8365893

Merge branch 'tianfu' into 'master'

fix: 修改bug,关于大屏设计器

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