统一 TenantApi 的封装,与 yudao-cloud~

This commit is contained in:
YunaiV
2022-06-16 22:29:59 +08:00
parent 58e4f11cca
commit d1271f8bff
5 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.api.tenant;
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 多租户的 API 实现类
*
* @author 芋道源码
*/
@Service
public class TenantApiImpl implements TenantApi {
@Resource
private TenantService tenantService;
@Override
public List<Long> getTenantIds() {
return tenantService.getTenantIds();
}
@Override
public void validTenant(Long id) {
tenantService.validTenant(id);
}
}

View File

@ -120,4 +120,18 @@ public interface TenantService extends TenantFrameworkService {
* @param handler 处理器
*/
void handleTenantMenu(TenantMenuHandler handler);
/**
* 获得所有租户
*
* @return 租户编号数组
*/
List<Long> getTenantIds();
/**
* 校验租户是否合法
*
* @param id 租户编号
*/
void validTenant(Long id);
}