| | |
| | | import org.dromara.system.domain.bo.SysTenantBo; |
| | | import org.dromara.system.domain.vo.SysTenantVo; |
| | | import org.dromara.system.service.ISysTenantService; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/system/tenant") |
| | | @ConditionalOnProperty(value = "tenant.enable", havingValue = "true") |
| | | public class SysTenantController extends BaseController { |
| | | |
| | | private final ISysTenantService tenantService; |
| | |
| | | @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) |
| | | @GetMapping("/dynamic/{tenantId}") |
| | | public R<Void> dynamicTenant(@NotBlank(message = "租户ID不能为空") @PathVariable String tenantId) { |
| | | TenantHelper.setDynamic(tenantId); |
| | | TenantHelper.setDynamic(tenantId, true); |
| | | return R.ok(); |
| | | } |
| | | |