| | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | |
| | | import org.springblade.system.entity.TenantPackage; |
| | | import org.springblade.system.service.ITenantPackageService; |
| | | import org.springblade.system.service.ITenantService; |
| | | import org.springblade.system.vo.TenantVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "新增或修改", notes = "传入tenant") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public R submit(@Valid @RequestBody Tenant tenant) { |
| | | return R.status(tenantService.submitTenant(tenant)); |
| | | public R submit(@Valid @RequestBody TenantVO tenantVO) { |
| | | System.out.println(tenantVO); |
| | | return R.status(tenantService.submitTenant(tenantVO)); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 授权配置 |
| | | */ |
| | | @PostMapping("/setting") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "授权配置", notes = "传入ids,accountNumber,expireTime") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public R setting(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @ApiParam(value = "账号额度") Integer accountNumber, @ApiParam(value = "过期时间") Date expireTime) { |
| | | return R.status(tenantService.setting(accountNumber, expireTime, ids)); |
| | | } |
| | | |
| | | /** |
| | | * 数据源配置 |
| | | */ |
| | | @PostMapping("datasource") |
| | | @PostMapping("/datasource") |
| | | @ApiOperationSupport(order = 8) |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperation(value = "数据源配置", notes = "传入datasource_id") |
| | |
| | | return R.status(tenantService.update(Wrappers.<Tenant>update().lambda().set(Tenant::getPackageId, packageId).eq(Tenant::getTenantId, tenantId))); |
| | | } |
| | | |
| | | /** |
| | | * 查询租户信息,简键值对形势 |
| | | * @return |
| | | */ |
| | | @GetMapping("/tenant-map") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "下拉租户信息") |
| | | public R<List> findAll() { |
| | | List<Map<String, Object>> map = tenantService.selectMaps(); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 查询是否配置有默认必须开启三员管理 |
| | | * @return |
| | | */ |
| | | @GetMapping("/find-ssa-enable") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "下拉租户信息") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public R findIsOpen() { |
| | | boolean isOpen = this.tenantService.findIsOpen(); |
| | | return R.data(isOpen); |
| | | } |
| | | |
| | | } |