Commit e62d0897 authored by suhuiguang's avatar suhuiguang

fix(common): 雪花算法id

1.防止重复增加配置项
parent 204f80b8
...@@ -52,7 +52,10 @@ public class DataSourceConfiguration { ...@@ -52,7 +52,10 @@ public class DataSourceConfiguration {
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
bean.setMapperLocations(resolver.getResources("classpath*:mapper/*.xml")); bean.setMapperLocations(resolver.getResources("classpath*:mapper/*.xml"));
bean.setConfigurationProperties(mybatisPlusProperties.getConfigurationProperties()); bean.setConfigurationProperties(mybatisPlusProperties.getConfigurationProperties());
GlobalConfig globalConfig = new GlobalConfig(); GlobalConfig globalConfig = mybatisPlusProperties.getGlobalConfig();
if(globalConfig == null) {
globalConfig = new GlobalConfig();
}
globalConfig.setSqlInjector(new MybatisSqlInjector()); globalConfig.setSqlInjector(new MybatisSqlInjector());
globalConfig.setMetaObjectHandler(metaHandler); globalConfig.setMetaObjectHandler(metaHandler);
bean.setGlobalConfig(globalConfig); bean.setGlobalConfig(globalConfig);
......
...@@ -93,4 +93,9 @@ amos.system.user.product=STUDIO_APP_WEB ...@@ -93,4 +93,9 @@ amos.system.user.product=STUDIO_APP_WEB
#Seata Config #Seata Config
seata.tx-service-group= tzs-seata seata.tx-service-group= tzs-seata
seata.service.grouplist.tzs-seata=172.16.10.243:8091 seata.service.grouplist.tzs-seata=172.16.10.243:8091
\ No newline at end of file
# ??????(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 { ...@@ -52,7 +52,10 @@ public class DataSourceConfiguration {
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
bean.setMapperLocations(resolver.getResources("classpath*:mapper/*.xml")); bean.setMapperLocations(resolver.getResources("classpath*:mapper/*.xml"));
bean.setConfigurationProperties(mybatisPlusProperties.getConfigurationProperties()); bean.setConfigurationProperties(mybatisPlusProperties.getConfigurationProperties());
GlobalConfig globalConfig = new GlobalConfig(); GlobalConfig globalConfig = mybatisPlusProperties.getGlobalConfig();
if(globalConfig == null) {
globalConfig = new GlobalConfig();
}
globalConfig.setSqlInjector(new MybatisSqlInjector()); globalConfig.setSqlInjector(new MybatisSqlInjector());
globalConfig.setMetaObjectHandler(metaHandler); globalConfig.setMetaObjectHandler(metaHandler);
bean.setGlobalConfig(globalConfig); bean.setGlobalConfig(globalConfig);
......
...@@ -78,3 +78,8 @@ inspection.rule.enabled.DTJC=true ...@@ -78,3 +78,8 @@ inspection.rule.enabled.DTJC=true
inspection.rule.enabled.WTJY=true inspection.rule.enabled.WTJY=true
inspection.rule.enabled.SCJY=true inspection.rule.enabled.SCJY=true
inspection.rule.enabled.DQRBI=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