mirror of
https://github.com/thousmile/molly-multi-tenant.git
synced 2025-12-30 04:32:26 +00:00
1.修改ConfigNameConst 为 ConfigDataConst 添加默认 部门ID、项目ID、角色名称 数据
This commit is contained in:
@@ -6,6 +6,7 @@ import org.apache.commons.collections4.keyvalue.DefaultKeyValue;
|
||||
/**
|
||||
* <p>
|
||||
* 全局配置文件 key
|
||||
* DefConfigValueConst
|
||||
* </p>
|
||||
*
|
||||
* @author Wang Chen Chen
|
||||
@@ -13,7 +14,7 @@ import org.apache.commons.collections4.keyvalue.DefaultKeyValue;
|
||||
* @date 2021/7/16 15:15
|
||||
*/
|
||||
|
||||
public class ConfigNameConst {
|
||||
public class ConfigDataConst {
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
@@ -24,27 +25,44 @@ public class ConfigNameConst {
|
||||
/**
|
||||
* 用户默认密码
|
||||
*/
|
||||
public static final KeyValue<String, String> USER_DEFAULT_PASSWORD = new DefaultKeyValue<>("default_user_password", "1234546");
|
||||
public static final KeyValue<String, String> DEFAULT_USER_PASSWORD = new DefaultKeyValue<>("default_user_password", "1234546");
|
||||
|
||||
|
||||
/**
|
||||
* 项目默认密码
|
||||
*/
|
||||
public static final KeyValue<String, String> PROJECT_DEFAULT_PASSWORD = new DefaultKeyValue<>("default_project_password", "1234546");
|
||||
public static final KeyValue<String, String> DEFAULT_PROJECT_PASSWORD = new DefaultKeyValue<>("default_project_password", "1234546");
|
||||
|
||||
|
||||
/**
|
||||
* 每个租户的 默认项目ID
|
||||
*/
|
||||
public static final KeyValue<String, Long> DEFAULT_PROJECT_ID = new DefaultKeyValue<>("default_project_id", 10001L);
|
||||
|
||||
|
||||
/**
|
||||
* 租户默认logo
|
||||
*/
|
||||
public static final KeyValue<String, String> TENANT_DEFAULT_LOGO = new DefaultKeyValue<>("default_tenant_logo", "https://images.xaaef.com/molly_master_logo.png");
|
||||
public static final KeyValue<String, String> DEFAULT_TENANT_LOGO = new DefaultKeyValue<>("default_tenant_logo", "https://images.xaaef.com/molly_master_logo.png");
|
||||
|
||||
|
||||
/**
|
||||
* 租户默认角色名称
|
||||
* 租户默认 角色名称
|
||||
*/
|
||||
public static final KeyValue<String, String> TENANT_DEFAULT_ROLE_NAME = new DefaultKeyValue<>("default_role_name", "操作员");
|
||||
public static final KeyValue<String, String> DEFAULT_ROLE_NAME = new DefaultKeyValue<>("default_role_name", "操作员");
|
||||
|
||||
|
||||
/**
|
||||
* 每个租户的 默认角色 ID
|
||||
*/
|
||||
public static final KeyValue<String, Long> DEFAULT_ROLE_ID = new DefaultKeyValue<>("default_role_id", 10001L);
|
||||
|
||||
|
||||
/**
|
||||
* 每个租户的 默认部门ID
|
||||
*/
|
||||
public static final KeyValue<String, Long> DEFAULT_DEPT_ID = new DefaultKeyValue<>("default_dept_id", 10001L);
|
||||
|
||||
/**
|
||||
* 获取法定节假日的接口
|
||||
*/
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.xaaef.molly.common.consts;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 全局配置文件 key
|
||||
* </p>
|
||||
*
|
||||
* @author Wang Chen Chen
|
||||
* @version 1.0.1
|
||||
* @date 2021/7/16 15:15
|
||||
*/
|
||||
|
||||
public class DefConfigValueConst {
|
||||
|
||||
/**
|
||||
* 每个租户的 默认项目ID
|
||||
*/
|
||||
public static final Long DEFAULT_PROJECT_ID = 10001L;
|
||||
|
||||
|
||||
/**
|
||||
* 每个租户的 默认部门ID
|
||||
*/
|
||||
public static final Long DEFAULT_DEPT_ID = 10001L;
|
||||
|
||||
/**
|
||||
* 每个租户的 默认角色 ID
|
||||
*/
|
||||
public static final Long DEFAULT_ROLE_ID = 10001L;
|
||||
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class RedisKeyConst {
|
||||
*/
|
||||
public final static Set<String> IGNORE_EQUALS_KEYS = Set.of(
|
||||
TenantUtils.X_TENANT_ID,
|
||||
ConfigNameConst.REDIS_CACHE_KEY
|
||||
ConfigDataConst.REDIS_CACHE_KEY
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.xaaef.molly.corems.api.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.xaaef.molly.common.consts.DefConfigValueConst;
|
||||
import com.xaaef.molly.common.enums.StatusEnum;
|
||||
import com.xaaef.molly.corems.entity.CmsProject;
|
||||
import com.xaaef.molly.corems.entity.TenantAndProject;
|
||||
@@ -22,7 +21,7 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.xaaef.molly.auth.jwt.JwtSecurityUtils.encryptPassword;
|
||||
import static com.xaaef.molly.common.consts.ConfigNameConst.PROJECT_DEFAULT_PASSWORD;
|
||||
import static com.xaaef.molly.common.consts.ConfigDataConst.*;
|
||||
import static com.xaaef.molly.tenant.util.DelegateUtils.delegate;
|
||||
|
||||
/**
|
||||
@@ -79,12 +78,12 @@ public class ApiCmsProjectServiceImpl implements ApiCmsProjectService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void initProject(SysTenantDTO po) {
|
||||
var password = Optional.ofNullable(configService.getValueByKey(PROJECT_DEFAULT_PASSWORD.getKey()))
|
||||
.orElse(PROJECT_DEFAULT_PASSWORD.getValue());
|
||||
var password = Optional.ofNullable(configService.getValueByKey(DEFAULT_PROJECT_PASSWORD.getKey()))
|
||||
.orElse(DEFAULT_PROJECT_PASSWORD.getValue());
|
||||
// 委托,新的租户id。执行初始化数据
|
||||
delegate(po.getTenantId(), () -> {
|
||||
var project = new CmsProject()
|
||||
.setProjectId(DefConfigValueConst.DEFAULT_PROJECT_ID)
|
||||
.setProjectId(DEFAULT_PROJECT_ID.getValue())
|
||||
.setProjectName("默认项目")
|
||||
.setLinkman(po.getLinkman())
|
||||
.setContactNumber(po.getContactNumber())
|
||||
@@ -93,7 +92,7 @@ public class ApiCmsProjectServiceImpl implements ApiCmsProjectService {
|
||||
.setSort(1L)
|
||||
.setPassword(encryptPassword(password))
|
||||
.setStatus(StatusEnum.NORMAL.getCode())
|
||||
.setDeptId(DefConfigValueConst.DEFAULT_DEPT_ID);
|
||||
.setDeptId(DEFAULT_DEPT_ID.getValue());
|
||||
projectMapper.insert(project);
|
||||
var result = new CmsProjectDTO();
|
||||
BeanUtils.copyProperties(project, result);
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.xaaef.molly.auth.jwt.JwtSecurityUtils.*;
|
||||
import static com.xaaef.molly.common.consts.ConfigNameConst.PROJECT_DEFAULT_PASSWORD;
|
||||
import static com.xaaef.molly.common.consts.ConfigDataConst.DEFAULT_PROJECT_PASSWORD;
|
||||
import static com.xaaef.molly.common.consts.MbpConst.PROJECT_ID;
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ public class CmsProjectServiceImpl extends BaseServiceImpl<CmsProjectMapper, Cms
|
||||
throw new RuntimeException("项目所属部门必须填写!");
|
||||
}
|
||||
if (StrUtil.isEmpty(entity.getPassword())) {
|
||||
var password = Optional.ofNullable(configService.getValueByKey(PROJECT_DEFAULT_PASSWORD.getKey()))
|
||||
.orElse(PROJECT_DEFAULT_PASSWORD.getValue());
|
||||
var password = Optional.ofNullable(configService.getValueByKey(DEFAULT_PROJECT_PASSWORD.getKey()))
|
||||
.orElse(DEFAULT_PROJECT_PASSWORD.getValue());
|
||||
entity.setPassword(password);
|
||||
}
|
||||
entity.setPassword(encryptPassword(entity.getPassword()));
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.xaaef.molly.perms.api.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.xaaef.molly.common.consts.DefConfigValueConst;
|
||||
import com.xaaef.molly.common.enums.StatusEnum;
|
||||
import com.xaaef.molly.common.util.IdUtils;
|
||||
import com.xaaef.molly.internal.api.ApiPmsUserService;
|
||||
@@ -26,7 +25,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.xaaef.molly.auth.jwt.JwtSecurityUtils.encryptPassword;
|
||||
import static com.xaaef.molly.common.consts.ConfigNameConst.TENANT_DEFAULT_ROLE_NAME;
|
||||
import static com.xaaef.molly.common.consts.ConfigDataConst.*;
|
||||
import static com.xaaef.molly.common.enums.AdminFlag.YES;
|
||||
import static com.xaaef.molly.common.enums.GenderType.MALE;
|
||||
import static com.xaaef.molly.tenant.util.DelegateUtils.delegate;
|
||||
@@ -113,13 +112,13 @@ public class ApiPmsUserServiceImpl implements ApiPmsUserService {
|
||||
@Override
|
||||
public void initUserAndRoleAndDept(InitUserDTO po) {
|
||||
// 租户默认角色名称
|
||||
var roleName = Optional.ofNullable(configService.getValueByKey(TENANT_DEFAULT_ROLE_NAME.getKey()))
|
||||
.orElse(TENANT_DEFAULT_ROLE_NAME.getValue());
|
||||
var roleName = Optional.ofNullable(configService.getValueByKey(DEFAULT_ROLE_NAME.getKey()))
|
||||
.orElse(DEFAULT_ROLE_NAME.getValue());
|
||||
// 委托,新的租户id。执行初始化数据
|
||||
delegate(po.getTenantId(), () -> {
|
||||
|
||||
var pmsDept = new PmsDept()
|
||||
.setDeptId(DefConfigValueConst.DEFAULT_DEPT_ID)
|
||||
.setDeptId(DEFAULT_DEPT_ID.getValue())
|
||||
.setParentId(0L)
|
||||
.setDeptName(po.getName())
|
||||
.setLeader(po.getAdminNickname())
|
||||
@@ -133,7 +132,7 @@ public class ApiPmsUserServiceImpl implements ApiPmsUserService {
|
||||
|
||||
var newRoleName = String.format("%s %s", po.getName(), roleName);
|
||||
var pmsRole = new PmsRole()
|
||||
.setRoleId(DefConfigValueConst.DEFAULT_ROLE_ID)
|
||||
.setRoleId(DEFAULT_ROLE_ID.getValue())
|
||||
.setRoleName(newRoleName)
|
||||
.setSort(1L)
|
||||
.setDescription(newRoleName);
|
||||
|
||||
@@ -44,7 +44,7 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.xaaef.molly.auth.jwt.JwtSecurityUtils.*;
|
||||
import static com.xaaef.molly.common.consts.ConfigNameConst.USER_DEFAULT_PASSWORD;
|
||||
import static com.xaaef.molly.common.consts.ConfigDataConst.DEFAULT_USER_PASSWORD;
|
||||
import static com.xaaef.molly.common.enums.AdminFlag.NO;
|
||||
import static com.xaaef.molly.common.enums.MenuTypeEnum.BUTTON;
|
||||
import static com.xaaef.molly.common.enums.MenuTypeEnum.MENU;
|
||||
@@ -137,8 +137,8 @@ public class PmsUserServiceImpl extends BaseServiceImpl<PmsUserMapper, PmsUser>
|
||||
}
|
||||
// 如果用户密码为空
|
||||
if (StringUtils.isBlank(entity.getPassword())) {
|
||||
var userDefaultPassword = Optional.ofNullable(configService.getValueByKey(USER_DEFAULT_PASSWORD.getKey()))
|
||||
.orElse(USER_DEFAULT_PASSWORD.getValue());
|
||||
var userDefaultPassword = Optional.ofNullable(configService.getValueByKey(DEFAULT_USER_PASSWORD.getKey()))
|
||||
.orElse(DEFAULT_USER_PASSWORD.getValue());
|
||||
entity.setPassword(userDefaultPassword);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.xaaef.molly;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.xaaef.molly.auth.enums.GrantType;
|
||||
import com.xaaef.molly.auth.jwt.JwtLoginUser;
|
||||
import com.xaaef.molly.common.consts.ConfigNameConst;
|
||||
import com.xaaef.molly.common.consts.ConfigDataConst;
|
||||
import com.xaaef.molly.common.enums.AdminFlag;
|
||||
import com.xaaef.molly.common.enums.GenderType;
|
||||
import com.xaaef.molly.common.enums.StatusEnum;
|
||||
@@ -107,7 +107,7 @@ public class MollyApplicationTests {
|
||||
@Test
|
||||
public void test2() throws Exception {
|
||||
TenantUtils.setTenantId("master");
|
||||
var valueByKey = configService.getValueByKey(ConfigNameConst.USER_DEFAULT_PASSWORD.getKey());
|
||||
var valueByKey = configService.getValueByKey(ConfigDataConst.DEFAULT_USER_PASSWORD.getKey());
|
||||
System.out.println(valueByKey);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.github.yitter.contract.IdGeneratorOptions;
|
||||
import com.github.yitter.idgen.YitIdHelper;
|
||||
import com.mysql.cj.jdbc.MysqlDataSource;
|
||||
import com.xaaef.molly.auth.jwt.JwtSecurityUtils;
|
||||
import com.xaaef.molly.common.consts.ConfigNameConst;
|
||||
import com.xaaef.molly.common.consts.ConfigDataConst;
|
||||
import com.xaaef.molly.common.consts.JwtConst;
|
||||
import com.xaaef.molly.common.util.JsonUtils;
|
||||
import com.xaaef.molly.common.util.TenantUtils;
|
||||
@@ -222,11 +222,11 @@ public class NoSpringTests {
|
||||
LOGIN_TOKEN_KEY,
|
||||
FORCED_OFFLINE_KEY,
|
||||
TenantUtils.X_TENANT_ID,
|
||||
ConfigNameConst.REDIS_CACHE_KEY,
|
||||
ConfigNameConst.USER_DEFAULT_PASSWORD.getKey(),
|
||||
ConfigNameConst.TENANT_DEFAULT_LOGO.getKey(),
|
||||
ConfigNameConst.TENANT_DEFAULT_ROLE_NAME.getKey(),
|
||||
ConfigNameConst.GET_HOLIDAY_URL.getKey()
|
||||
ConfigDataConst.REDIS_CACHE_KEY,
|
||||
ConfigDataConst.DEFAULT_USER_PASSWORD.getKey(),
|
||||
ConfigDataConst.DEFAULT_TENANT_LOGO.getKey(),
|
||||
ConfigDataConst.DEFAULT_ROLE_NAME.getKey(),
|
||||
ConfigDataConst.GET_HOLIDAY_URL.getKey()
|
||||
);
|
||||
var str = "waeq" + IdUtil.nanoId();
|
||||
boolean b1 = ignoreContainsKeys.stream().noneMatch(s -> StrUtil.contains(str, s));
|
||||
|
||||
@@ -4,7 +4,7 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.xaaef.molly.auth.jwt.JwtSecurityUtils;
|
||||
import com.xaaef.molly.common.consts.ConfigNameConst;
|
||||
import com.xaaef.molly.common.consts.ConfigDataConst;
|
||||
import com.xaaef.molly.common.util.JsonUtils;
|
||||
import com.xaaef.molly.system.entity.SysConfig;
|
||||
import com.xaaef.molly.system.mapper.SysConfigMapper;
|
||||
@@ -57,14 +57,14 @@ public class SysConfigServiceImpl extends BaseServiceImpl<SysConfigMapper, SysCo
|
||||
var configMaps = baseMapper.selectList(wrapper)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(SysConfig::getConfigKey, SysConfig::getConfigValue));
|
||||
hash().putAll(ConfigNameConst.REDIS_CACHE_KEY, configMaps);
|
||||
hash().putAll(ConfigDataConst.REDIS_CACHE_KEY, configMaps);
|
||||
log.info("SysConfig init success....");
|
||||
}
|
||||
|
||||
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
redisTemplate.delete(ConfigNameConst.REDIS_CACHE_KEY);
|
||||
redisTemplate.delete(ConfigDataConst.REDIS_CACHE_KEY);
|
||||
log.info("SysConfig destroy success....");
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class SysConfigServiceImpl extends BaseServiceImpl<SysConfigMapper, SysCo
|
||||
throw new RuntimeException("参数键名,已经存在了!");
|
||||
}
|
||||
if (StringUtils.isNotBlank(entity.getConfigValue())) {
|
||||
hash().put(ConfigNameConst.REDIS_CACHE_KEY, entity.getConfigKey(), entity.getConfigValue());
|
||||
hash().put(ConfigDataConst.REDIS_CACHE_KEY, entity.getConfigKey(), entity.getConfigValue());
|
||||
}
|
||||
return super.updateById(entity);
|
||||
}
|
||||
@@ -109,16 +109,16 @@ public class SysConfigServiceImpl extends BaseServiceImpl<SysConfigMapper, SysCo
|
||||
if (entity == null) {
|
||||
throw new RuntimeException("配置不存在!");
|
||||
}
|
||||
hash().delete(ConfigNameConst.REDIS_CACHE_KEY, entity.getConfigKey());
|
||||
hash().delete(ConfigDataConst.REDIS_CACHE_KEY, entity.getConfigKey());
|
||||
return super.removeById(entity.getConfigId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getValueByKey(String configKey) {
|
||||
var flag = hash().hasKey(ConfigNameConst.REDIS_CACHE_KEY, configKey);
|
||||
var flag = hash().hasKey(ConfigDataConst.REDIS_CACHE_KEY, configKey);
|
||||
if (Boolean.TRUE.equals(flag)) {
|
||||
var obj = hash().get(ConfigNameConst.REDIS_CACHE_KEY, configKey);
|
||||
var obj = hash().get(ConfigDataConst.REDIS_CACHE_KEY, configKey);
|
||||
return (String) obj;
|
||||
}
|
||||
var wrapper = new LambdaQueryWrapper<SysConfig>()
|
||||
@@ -126,7 +126,7 @@ public class SysConfigServiceImpl extends BaseServiceImpl<SysConfigMapper, SysCo
|
||||
.eq(SysConfig::getConfigKey, configKey);
|
||||
var config = baseMapper.selectOne(wrapper);
|
||||
if (config != null && StringUtils.isNotBlank(config.getConfigValue())) {
|
||||
hash().put(ConfigNameConst.REDIS_CACHE_KEY, configKey, config.getConfigValue());
|
||||
hash().put(ConfigDataConst.REDIS_CACHE_KEY, configKey, config.getConfigValue());
|
||||
return config.getConfigValue();
|
||||
}
|
||||
return StrUtil.EMPTY;
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xaaef.molly.auth.jwt.JwtLoginUser;
|
||||
import com.xaaef.molly.auth.jwt.JwtSecurityUtils;
|
||||
import com.xaaef.molly.common.consts.DefConfigValueConst;
|
||||
import com.xaaef.molly.common.domain.SimpPushMessage;
|
||||
import com.xaaef.molly.common.domain.SmallTenant;
|
||||
import com.xaaef.molly.common.enums.StatusEnum;
|
||||
@@ -49,8 +48,7 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.xaaef.molly.auth.jwt.JwtSecurityUtils.*;
|
||||
import static com.xaaef.molly.common.consts.ConfigNameConst.TENANT_DEFAULT_LOGO;
|
||||
import static com.xaaef.molly.common.consts.ConfigNameConst.USER_DEFAULT_PASSWORD;
|
||||
import static com.xaaef.molly.common.consts.ConfigDataConst.*;
|
||||
import static com.xaaef.molly.common.consts.SimpMessageConst.QUEUE_SINGLE_CREATE_TENANT;
|
||||
import static com.xaaef.molly.tenant.util.DelegateUtils.delegate;
|
||||
|
||||
@@ -197,8 +195,8 @@ public class SysTenantServiceImpl extends BaseServiceImpl<SysTenantMapper, SysTe
|
||||
entity.setStatus(StatusEnum.NORMAL.getCode());
|
||||
}
|
||||
if (entity.getLogo() == null) {
|
||||
var defaultLogoPath = Optional.ofNullable(configService.getValueByKey(TENANT_DEFAULT_LOGO.getKey()))
|
||||
.orElse(TENANT_DEFAULT_LOGO.getValue());
|
||||
var defaultLogoPath = Optional.ofNullable(configService.getValueByKey(DEFAULT_TENANT_LOGO.getKey()))
|
||||
.orElse(DEFAULT_TENANT_LOGO.getValue());
|
||||
entity.setLogo(defaultLogoPath);
|
||||
}
|
||||
if (entity.getTemplates() != null && !entity.getTemplates().isEmpty()) {
|
||||
@@ -246,8 +244,8 @@ public class SysTenantServiceImpl extends BaseServiceImpl<SysTenantMapper, SysTe
|
||||
|
||||
// 默认密码
|
||||
if (StringUtils.isBlank(po.getAdminPwd())) {
|
||||
var password = Optional.ofNullable(configService.getValueByKey(USER_DEFAULT_PASSWORD.getKey()))
|
||||
.orElse(USER_DEFAULT_PASSWORD.getValue());
|
||||
var password = Optional.ofNullable(configService.getValueByKey(DEFAULT_USER_PASSWORD.getKey()))
|
||||
.orElse(DEFAULT_USER_PASSWORD.getValue());
|
||||
po.setAdminPwd(password);
|
||||
}
|
||||
|
||||
@@ -318,8 +316,8 @@ public class SysTenantServiceImpl extends BaseServiceImpl<SysTenantMapper, SysTe
|
||||
var initTenantDTO = new SysTenantDTO();
|
||||
BeanUtils.copyProperties(source, initTenantDTO);
|
||||
|
||||
var password = Optional.ofNullable(configService.getValueByKey(USER_DEFAULT_PASSWORD.getKey()))
|
||||
.orElse(USER_DEFAULT_PASSWORD.getValue());
|
||||
var password = Optional.ofNullable(configService.getValueByKey(DEFAULT_USER_PASSWORD.getKey()))
|
||||
.orElse(DEFAULT_USER_PASSWORD.getValue());
|
||||
var initUser = new InitUserDTO()
|
||||
.setTenantId(source.getTenantId())
|
||||
.setName(source.getName())
|
||||
@@ -390,7 +388,7 @@ public class SysTenantServiceImpl extends BaseServiceImpl<SysTenantMapper, SysTe
|
||||
projectService.initProject(initTenant);
|
||||
|
||||
var smallTenant = BeanUtil.copyProperties(initTenant, SmallTenant.class);
|
||||
smallTenant.setProjectIds(new HashSet<>(Set.of(DefConfigValueConst.DEFAULT_PROJECT_ID)));
|
||||
smallTenant.setProjectIds(new HashSet<>(Set.of(DEFAULT_PROJECT_ID.getValue())));
|
||||
// 将 新创建的 租户信息 保存到 redis 中
|
||||
tenantManager.addTenantId(smallTenant);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user