Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system
This commit is contained in:
commit
d1cd46f67f
@ -54,6 +54,17 @@ public class TenantController {
|
||||
return success(tenant != null ? tenant.getId() : null);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getListByWebsite")
|
||||
@PermitAll
|
||||
@Operation(summary = "使用域名,获得租户信息", description = "登录界面,根据用户的域名,获得租户信息")
|
||||
@Parameter(name = "website", description = "域名", required = true, example = "www.iocoder.cn")
|
||||
public CommonResult<?> getListByWebsite(@RequestParam("website") String website) {
|
||||
List<TenantDO> tenants = tenantService.getListByWebsite(website);
|
||||
return success(tenants);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建租户")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant:create')")
|
||||
|
@ -135,4 +135,5 @@ public interface TenantService {
|
||||
*/
|
||||
void validTenant(Long id);
|
||||
|
||||
List<TenantDO> getListByWebsite(String website);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ import cn.iocoder.yudao.module.system.service.tenant.handler.TenantMenuHandler;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -106,6 +107,13 @@ public class TenantServiceImpl implements TenantService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TenantDO> getListByWebsite(String website) {
|
||||
QueryWrapper<TenantDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("website", website);
|
||||
return tenantMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换
|
||||
public Long createTenant(TenantSaveReqVO createReqVO) {
|
||||
|
Loading…
Reference in New Issue
Block a user