Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
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
yaru
fgqyxxlr
Commits
316b126c
Commit
316b126c
authored
Mar 18, 2019
by
dhx920
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正DynamicDataSourceContextHolder类中三处DataSource拼写错误
parent
f7a9f338
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
ruoyi-common/src/main/java/com/ruoyi/common/config/datasource/DynamicDataSourceContextHolder.java
+3
-3
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
+2
-2
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java
+2
-1
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/config/datasource/DynamicDataSourceContextHolder.java
View file @
316b126c
...
...
@@ -21,7 +21,7 @@ public class DynamicDataSourceContextHolder
/**
* 设置数据源的变量
*/
public
static
void
setDat
eSour
eType
(
String
dsType
)
public
static
void
setDat
aSourc
eType
(
String
dsType
)
{
log
.
info
(
"切换到{}数据源"
,
dsType
);
CONTEXT_HOLDER
.
set
(
dsType
);
...
...
@@ -30,7 +30,7 @@ public class DynamicDataSourceContextHolder
/**
* 获得数据源的变量
*/
public
static
String
getDat
eSour
eType
()
public
static
String
getDat
aSourc
eType
()
{
return
CONTEXT_HOLDER
.
get
();
}
...
...
@@ -38,7 +38,7 @@ public class DynamicDataSourceContextHolder
/**
* 清空数据源变量
*/
public
static
void
clearDat
eSour
eType
()
public
static
void
clearDat
aSourc
eType
()
{
CONTEXT_HOLDER
.
remove
();
}
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
View file @
316b126c
...
...
@@ -43,7 +43,7 @@ public class DataSourceAspect
if
(
StringUtils
.
isNotNull
(
dataSource
))
{
DynamicDataSourceContextHolder
.
setDat
eSour
eType
(
dataSource
.
value
().
name
());
DynamicDataSourceContextHolder
.
setDat
aSourc
eType
(
dataSource
.
value
().
name
());
}
try
...
...
@@ -53,7 +53,7 @@ public class DataSourceAspect
finally
{
// 销毁数据源 在执行方法之后
DynamicDataSourceContextHolder
.
clearDat
eSour
eType
();
DynamicDataSourceContextHolder
.
clearDat
aSourc
eType
();
}
}
}
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java
View file @
316b126c
...
...
@@ -22,6 +22,6 @@ public class DynamicDataSource extends AbstractRoutingDataSource
@Override
protected
Object
determineCurrentLookupKey
()
{
return
DynamicDataSourceContextHolder
.
getDat
eSour
eType
();
return
DynamicDataSourceContextHolder
.
getDat
aSourc
eType
();
}
}
\ No newline at end of file
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