Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
3d50446b
Commit
3d50446b
authored
Nov 17, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(common): 雪花算法id
1.防止重复增加配置项
parent
9bfd76b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
39 deletions
+13
-39
MyBatisPlusConfig.java
...a/com/yeejoin/amos/boot/biz/config/MyBatisPlusConfig.java
+10
-4
DataSourceConfiguration.java
...os/boot/module/jg/biz/config/DataSourceConfiguration.java
+1
-13
DataSourceConfiguration.java
.../boot/module/jyjc/biz/config/DataSourceConfiguration.java
+1
-12
DataSourceConfiguration.java
...os/boot/module/ys/biz/config/DataSourceConfiguration.java
+1
-10
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/config/MyBatisPlusConfig.java
View file @
3d50446b
...
@@ -19,14 +19,15 @@ public class MyBatisPlusConfig {
...
@@ -19,14 +19,15 @@ public class MyBatisPlusConfig {
* @return
* @return
*/
*/
@Bean
@Bean
public
GlobalConfig
globalConfig
(
MybatisPlusProperties
mybatisPlusProperties
)
{
public
GlobalConfig
globalConfig
(
MybatisPlusProperties
mybatisPlusProperties
,
MetaHandler
metaHandler
,
MybatisSqlInjector
mybatisSqlInjector
)
{
GlobalConfig
globalConfig
=
mybatisPlusProperties
.
getGlobalConfig
();
GlobalConfig
globalConfig
=
mybatisPlusProperties
.
getGlobalConfig
();
if
(
globalConfig
==
null
)
{
if
(
globalConfig
==
null
)
{
globalConfig
=
new
GlobalConfig
();
globalConfig
=
new
GlobalConfig
();
}
}
if
(
globalConfig
.
getMetaObjectHandler
()
==
null
)
{
if
(
globalConfig
.
getMetaObjectHandler
()
==
null
)
{
globalConfig
.
setMetaObjectHandler
(
new
MetaHandler
()
);
globalConfig
.
setMetaObjectHandler
(
metaHandler
);
}
}
globalConfig
.
setSqlInjector
(
mybatisSqlInjector
);
return
globalConfig
;
return
globalConfig
;
}
}
...
@@ -45,4 +46,9 @@ public class MyBatisPlusConfig {
...
@@ -45,4 +46,9 @@ public class MyBatisPlusConfig {
public
PermissionInterceptor
permissionInterceptor
()
{
public
PermissionInterceptor
permissionInterceptor
()
{
return
new
PermissionInterceptor
();
return
new
PermissionInterceptor
();
}
}
@Bean
public
MybatisSqlInjector
mybatisSqlInjector
()
{
return
new
MybatisSqlInjector
();
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/config/DataSourceConfiguration.java
View file @
3d50446b
...
@@ -45,27 +45,15 @@ public class DataSourceConfiguration {
...
@@ -45,27 +45,15 @@ public class DataSourceConfiguration {
}
}
@Bean
(
name
=
"sqlSessionFactory"
)
@Bean
(
name
=
"sqlSessionFactory"
)
@Autowired
public
SqlSessionFactory
sqlSessionFactoryBean
(
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MybatisPlusProperties
mybatisPlusProperties
,
GlobalConfig
globalConfig
)
throws
Exception
{
public
SqlSessionFactory
sqlSessionFactoryBean
(
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MetaHandler
metaHandler
,
MybatisPlusProperties
mybatisPlusProperties
)
throws
Exception
{
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSourceProxy
);
bean
.
setDataSource
(
dataSourceProxy
);
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
=
mybatisPlusProperties
.
getGlobalConfig
();
if
(
globalConfig
==
null
)
{
globalConfig
=
new
GlobalConfig
();
}
globalConfig
.
setSqlInjector
(
new
MybatisSqlInjector
());
globalConfig
.
setMetaObjectHandler
(
metaHandler
);
bean
.
setGlobalConfig
(
globalConfig
);
bean
.
setGlobalConfig
(
globalConfig
);
Interceptor
[]
plugins
=
{
paginationInterceptor
};
Interceptor
[]
plugins
=
{
paginationInterceptor
};
bean
.
setPlugins
(
plugins
);
bean
.
setPlugins
(
plugins
);
return
bean
.
getObject
();
return
bean
.
getObject
();
}
}
@Bean
public
MetaHandler
metaHandler
()
{
return
new
MetaHandler
();
}
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/config/DataSourceConfiguration.java
View file @
3d50446b
...
@@ -45,27 +45,16 @@ public class DataSourceConfiguration {
...
@@ -45,27 +45,16 @@ public class DataSourceConfiguration {
}
}
@Bean
(
name
=
"sqlSessionFactory"
)
@Bean
(
name
=
"sqlSessionFactory"
)
@Autowired
public
SqlSessionFactory
sqlSessionFactoryBean
(
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MybatisPlusProperties
mybatisPlusProperties
,
GlobalConfig
globalConfig
)
throws
Exception
{
public
SqlSessionFactory
sqlSessionFactoryBean
(
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MetaHandler
metaHandler
,
MybatisPlusProperties
mybatisPlusProperties
)
throws
Exception
{
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSourceProxy
);
bean
.
setDataSource
(
dataSourceProxy
);
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
=
mybatisPlusProperties
.
getGlobalConfig
();
if
(
globalConfig
==
null
)
{
globalConfig
=
new
GlobalConfig
();
}
globalConfig
.
setSqlInjector
(
new
MybatisSqlInjector
());
globalConfig
.
setMetaObjectHandler
(
metaHandler
);
bean
.
setGlobalConfig
(
globalConfig
);
bean
.
setGlobalConfig
(
globalConfig
);
Interceptor
[]
plugins
=
{
paginationInterceptor
};
Interceptor
[]
plugins
=
{
paginationInterceptor
};
bean
.
setPlugins
(
plugins
);
bean
.
setPlugins
(
plugins
);
return
bean
.
getObject
();
return
bean
.
getObject
();
}
}
@Bean
public
MetaHandler
metaHandler
()
{
return
new
MetaHandler
();
}
}
}
amos-boot-system-tzs/amos-boot-module-ys/amos-boot-module-ys-biz/src/main/java/com/yeejoin/amos/boot/module/ys/biz/config/DataSourceConfiguration.java
View file @
3d50446b
...
@@ -44,24 +44,15 @@ public class DataSourceConfiguration {
...
@@ -44,24 +44,15 @@ public class DataSourceConfiguration {
}
}
@Bean
(
name
=
"sqlSessionFactory"
)
@Bean
(
name
=
"sqlSessionFactory"
)
@Autowired
public
SqlSessionFactory
sqlSessionFactoryBean
(
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MybatisPlusProperties
mybatisPlusProperties
,
GlobalConfig
globalConfig
)
throws
Exception
{
public
SqlSessionFactory
sqlSessionFactoryBean
(
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MetaHandler
metaHandler
,
MybatisPlusProperties
mybatisPlusProperties
)
throws
Exception
{
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSourceProxy
);
bean
.
setDataSource
(
dataSourceProxy
);
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
.
setSqlInjector
(
new
MybatisSqlInjector
());
globalConfig
.
setMetaObjectHandler
(
metaHandler
);
bean
.
setGlobalConfig
(
globalConfig
);
bean
.
setGlobalConfig
(
globalConfig
);
Interceptor
[]
plugins
=
{
paginationInterceptor
};
Interceptor
[]
plugins
=
{
paginationInterceptor
};
bean
.
setPlugins
(
plugins
);
bean
.
setPlugins
(
plugins
);
return
bean
.
getObject
();
return
bean
.
getObject
();
}
}
@Bean
public
MetaHandler
metaHandler
()
{
return
new
MetaHandler
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment