✨ Introducing new features. closed #3727 支持租户根据域名自动选择

This commit is contained in:
qraddx committed 2022-03-24 08:36:07 +08:00
1 parent 72d0fc82a9
commit 0210ed9b70
3 files changed
+13 -16

No files matched your search

+2 -1
View File
@@ -769,6 +769,7 @@ CREATE TABLE `sys_tenant` (
`id` bigint NOT NULL COMMENT '租户id',
`name` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
`code` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
`tenant_domain` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
`status` char(1) CHARACTER SET utf8mb4 DEFAULT '0',
@@ -784,7 +785,7 @@ CREATE TABLE `sys_tenant` (
-- Records of sys_tenant
-- ----------------------------
BEGIN;
INSERT INTO `sys_tenant` VALUES (1, '北京分公司', '1', '2019-05-15 00:00:00', '2029-05-15 00:00:00', '0', '0', ' ', ' ', '2019-05-15 15:44:57', '2022-02-10 05:38:48');
INSERT INTO `sys_tenant` VALUES (1, '北京分公司', '1', '','2019-05-15 00:00:00', '2029-05-15 00:00:00', '0', '0', ' ', ' ', '2019-05-15 15:44:57', '2022-02-10 05:38:48');
COMMIT;
-- ----------------------------
@@ -58,6 +58,12 @@ public class SysTenant extends Model<SysTenant> {
@ApiModelProperty(value = "租户编号")
private String code;
/**
* 租户域名
*/
@ApiModelProperty(value = "租户域名")
private String tenantDomain;
/**
* 开始时间
*/
@@ -61,23 +61,13 @@ public class SysTenantController {
}
/**
* 通过id查询租户
* @param id id
* @return R
*/
@GetMapping("/{id}")
public R getById(@PathVariable("id") Long id) {
return R.ok(sysTenantService.getById(id));
}
/**
* 通过租户编码查询租户信息
* @param code 租户Code
* 查询租户信息
* @param tenant 查询条件
* @return 租户信息
*/
@GetMapping("/code/{code}")
public R getByTenantCode(@PathVariable String code) {
return R.ok(sysTenantService.list(Wrappers.<SysTenant>lambdaQuery().eq(SysTenant::getCode, code)));
@GetMapping
public R getByObj(SysTenant tenant) {
return R.ok(sysTenantService.list(Wrappers.query(tenant)));
}
/**