Commit e62d0897 authored by suhuiguang's avatar suhuiguang

fix(common): 雪花算法id

1.防止重复增加配置项
parent 204f80b8
......@@ -52,7 +52,10 @@ public class DataSourceConfiguration {
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
bean.setMapperLocations(resolver.getResources("classpath*:mapper/*.xml"));
bean.setConfigurationProperties(mybatisPlusProperties.getConfigurationProperties());
GlobalConfig globalConfig = new GlobalConfig();
GlobalConfig globalConfig = mybatisPlusProperties.getGlobalConfig();
if(globalConfig == null) {
globalConfig = new GlobalConfig();
}
globalConfig.setSqlInjector(new MybatisSqlInjector());
globalConfig.setMetaObjectHandler(metaHandler);
bean.setGlobalConfig(globalConfig);
......
......@@ -94,3 +94,8 @@ amos.system.user.product=STUDIO_APP_WEB
#Seata Config
seata.tx-service-group= tzs-seata
seata.service.grouplist.tzs-seata=172.16.10.243:8091
# ??????(0<=datacenter-id<=31)
mybatis-plus.global-config.datacenter-id=1
# ??????(0<=worker-id<=31)
mybatis-plus.global-config.worker-id=2
\ No newline at end of file
......@@ -52,7 +52,10 @@ public class DataSourceConfiguration {
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
bean.setMapperLocations(resolver.getResources("classpath*:mapper/*.xml"));
bean.setConfigurationProperties(mybatisPlusProperties.getConfigurationProperties());
GlobalConfig globalConfig = new GlobalConfig();
GlobalConfig globalConfig = mybatisPlusProperties.getGlobalConfig();
if(globalConfig == null) {
globalConfig = new GlobalConfig();
}
globalConfig.setSqlInjector(new MybatisSqlInjector());
globalConfig.setMetaObjectHandler(metaHandler);
bean.setGlobalConfig(globalConfig);
......
......@@ -78,3 +78,8 @@ inspection.rule.enabled.DTJC=true
inspection.rule.enabled.WTJY=true
inspection.rule.enabled.SCJY=true
inspection.rule.enabled.DQRBI=true
# ??????(0<=datacenter-id<=31)
mybatis-plus.global-config.datacenter-id=1
# ??????(0<=worker-id<=31)
mybatis-plus.global-config.worker-id=2
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment