Commit c7f9a0de0b1b264494b1e1fb2d5136dc7c36e1e6
1 parent
7913ca24
refactor: 意见反馈业务逻辑调整
1、平台管理员或超级管理员可查看、删除。 2、所有用户可新增、编辑。
Showing
2 changed files
with
5 additions
and
3 deletions
@@ -23,13 +23,13 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant. | @@ -23,13 +23,13 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant. | ||
23 | @RequestMapping("api/yt/opinion") | 23 | @RequestMapping("api/yt/opinion") |
24 | @Api(tags = {"意见反馈"}) | 24 | @Api(tags = {"意见反馈"}) |
25 | @RequiredArgsConstructor | 25 | @RequiredArgsConstructor |
26 | -@PreAuthorize("hasAnyAuthority('TENANT_ADMIN','CUSTOMER_USER')") | ||
27 | public class YtOpinionController extends BaseController { | 26 | public class YtOpinionController extends BaseController { |
28 | 27 | ||
29 | private final YtOpinionService opinionService; | 28 | private final YtOpinionService opinionService; |
30 | 29 | ||
31 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 30 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
32 | @ApiOperation("分页") | 31 | @ApiOperation("分页") |
32 | + @PreAuthorize("hasAnyAuthority('PLATFORM_ADMIN','SYS_ADMIN')") | ||
33 | public YtPageData<YtOpinionDTO> pageAlarmProfile( | 33 | public YtPageData<YtOpinionDTO> pageAlarmProfile( |
34 | @RequestParam(PAGE_SIZE) int pageSize, | 34 | @RequestParam(PAGE_SIZE) int pageSize, |
35 | @RequestParam(PAGE) int page, | 35 | @RequestParam(PAGE) int page, |
@@ -58,6 +58,7 @@ public class YtOpinionController extends BaseController { | @@ -58,6 +58,7 @@ public class YtOpinionController extends BaseController { | ||
58 | } | 58 | } |
59 | 59 | ||
60 | @DeleteMapping | 60 | @DeleteMapping |
61 | + @PreAuthorize("hasAnyAuthority('PLATFORM_ADMIN','SYS_ADMIN')") | ||
61 | @ApiOperation("删除") | 62 | @ApiOperation("删除") |
62 | public boolean deleteAlarmProfile(@Validated(DeleteGroup.class) @RequestBody DeleteDTO deleteDTO) | 63 | public boolean deleteAlarmProfile(@Validated(DeleteGroup.class) @RequestBody DeleteDTO deleteDTO) |
63 | throws ThingsboardException { | 64 | throws ThingsboardException { |
@@ -66,6 +67,7 @@ public class YtOpinionController extends BaseController { | @@ -66,6 +67,7 @@ public class YtOpinionController extends BaseController { | ||
66 | } | 67 | } |
67 | 68 | ||
68 | @GetMapping("{entityId}") | 69 | @GetMapping("{entityId}") |
70 | + @PreAuthorize("hasAnyAuthority('PLATFORM_ADMIN','SYS_ADMIN')") | ||
69 | @ApiOperation("详情") | 71 | @ApiOperation("详情") |
70 | public YtOpinionDTO detail(@PathVariable("entityId") String entityId) | 72 | public YtOpinionDTO detail(@PathVariable("entityId") String entityId) |
71 | throws ThingsboardException { | 73 | throws ThingsboardException { |
@@ -45,7 +45,7 @@ public class YtOpinionServiceImpl extends AbstractBaseService<YtOpinionMapper, Y | @@ -45,7 +45,7 @@ public class YtOpinionServiceImpl extends AbstractBaseService<YtOpinionMapper, Y | ||
45 | @Override | 45 | @Override |
46 | public YtOpinionDTO detail(String tenantId, String entityId) { | 46 | public YtOpinionDTO detail(String tenantId, String entityId) { |
47 | Wrapper filter = new QueryWrapper<YtOpinionEntity>().lambda() | 47 | Wrapper filter = new QueryWrapper<YtOpinionEntity>().lambda() |
48 | - .eq(YtOpinionEntity::getTenantId,tenantId) | 48 | +// .eq(YtOpinionEntity::getTenantId,tenantId) |
49 | .eq(YtOpinionEntity::getId,entityId); | 49 | .eq(YtOpinionEntity::getId,entityId); |
50 | YtOpinionEntity self = baseMapper.selectOne(filter); | 50 | YtOpinionEntity self = baseMapper.selectOne(filter); |
51 | return self.getDTO(YtOpinionDTO.class); | 51 | return self.getDTO(YtOpinionDTO.class); |
@@ -76,7 +76,7 @@ public class YtOpinionServiceImpl extends AbstractBaseService<YtOpinionMapper, Y | @@ -76,7 +76,7 @@ public class YtOpinionServiceImpl extends AbstractBaseService<YtOpinionMapper, Y | ||
76 | @Transactional(rollbackFor=Exception.class) | 76 | @Transactional(rollbackFor=Exception.class) |
77 | public boolean deleteDataByIds(DeleteDTO deleteDTO) { | 77 | public boolean deleteDataByIds(DeleteDTO deleteDTO) { |
78 | Wrapper filter = new QueryWrapper<YtOpinionEntity>().lambda() | 78 | Wrapper filter = new QueryWrapper<YtOpinionEntity>().lambda() |
79 | - .eq(YtOpinionEntity::getTenantId,deleteDTO.getTenantId()) | 79 | +// .eq(YtOpinionEntity::getTenantId,deleteDTO.getTenantId()) |
80 | .in(YtOpinionEntity::getId,deleteDTO.getIds()); | 80 | .in(YtOpinionEntity::getId,deleteDTO.getIds()); |
81 | return baseMapper.delete(filter) > 0; | 81 | return baseMapper.delete(filter) > 0; |
82 | } | 82 | } |