diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java index 6de8a2cb..f2e3211e 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java @@ -49,7 +49,6 @@ import java.util.Map; @RequestMapping("/tenant") @ApiIgnore @Api(value = "租户管理", tags = "接口") -@PreAuth(RoleConstant.HAS_ROLE_ADMIN) public class TenantController extends BladeController { private ITenantService tenantService; @@ -60,6 +59,7 @@ public class TenantController extends BladeController { @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入tenant") + @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) public R detail(Tenant tenant) { Tenant detail = tenantService.getOne(Condition.getQueryWrapper(tenant)); return R.data(detail); @@ -76,6 +76,7 @@ public class TenantController extends BladeController { }) @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入tenant") + @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) public R> list(@ApiIgnore @RequestParam Map tenant, Query query, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(tenant, Tenant.class); IPage pages = tenantService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper); @@ -88,6 +89,7 @@ public class TenantController extends BladeController { @GetMapping("/select") @ApiOperationSupport(order = 3) @ApiOperation(value = "下拉数据源", notes = "传入tenant") + @PreAuth(RoleConstant.HAS_ROLE_ADMIN) public R> select(Tenant tenant, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(tenant); List list = tenantService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper); @@ -100,6 +102,7 @@ public class TenantController extends BladeController { @GetMapping("/page") @ApiOperationSupport(order = 4) @ApiOperation(value = "分页", notes = "传入tenant") + @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) public R> page(Tenant tenant, Query query) { IPage pages = tenantService.selectTenantPage(Condition.getPage(query), tenant); return R.data(pages); @@ -111,6 +114,7 @@ public class TenantController extends BladeController { @PostMapping("/submit") @ApiOperationSupport(order = 5) @ApiOperation(value = "新增或修改", notes = "传入tenant") + @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) public R submit(@Valid @RequestBody Tenant tenant) { return R.status(tenantService.saveTenant(tenant)); } @@ -122,6 +126,7 @@ public class TenantController extends BladeController { @PostMapping("/remove") @ApiOperationSupport(order = 6) @ApiOperation(value = "逻辑删除", notes = "传入ids") + @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(tenantService.deleteLogic(Func.toLongList(ids))); } @@ -134,6 +139,7 @@ public class TenantController extends BladeController { @GetMapping("/find-by-name") @ApiOperationSupport(order = 7) @ApiOperation(value = "详情", notes = "传入tenant") + @PreAuth(RoleConstant.HAS_ROLE_ADMIN) public R> findByName(String name) { List list = tenantService.list(Wrappers.query().lambda().like(Tenant::getTenantName, name)); return R.data(list);