Skip to content

Commit f20c348

Browse files
author
何惠民
committed
Changed java doc
1 parent b63df77 commit f20c348

18 files changed

+45
-49
lines changed

src/main/java/cn/com/hellowood/dynamicdatasource/common/CommonConstant.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* Common constant
55
*
6-
* @Date 2017-07-11 15:46
7-
* @Author HelloWood
6+
* @author HelloWood
7+
* @date 2017-07-11 15:46
88
* @Email hellowoodes@gmail.com
99
*/
1010
public class CommonConstant {

src/main/java/cn/com/hellowood/dynamicdatasource/common/CommonResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
/**
77
* Response bean for format response
88
*
9-
* @Date 2017-07-11 15:33
10-
* @Author HelloWood
9+
* @author HelloWood
10+
* @date 2017-07-11 15:33
1111
* @Email hellowoodes@gmail.com
1212
*/
1313
public class CommonResponse {

src/main/java/cn/com/hellowood/dynamicdatasource/common/ResponseCode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* Response code
55
*
6-
* @Date 2017-07-11 15:41
7-
* @Author HelloWood
6+
* @author HelloWood
7+
* @date 2017-07-11 15:41
88
* @Email hellowoodes@gmail.com
99
*/
1010
public enum ResponseCode {

src/main/java/cn/com/hellowood/dynamicdatasource/common/ResponseUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/**
1111
* Generate response for request
1212
*
13-
* @Date 2017-07-11 15:45
14-
* @Author HelloWood
13+
* @author HelloWood
14+
* @date 2017-07-11 15:45
1515
* @Email hellowoodes@gmail.com
1616
*/
1717
public class ResponseUtil {

src/main/java/cn/com/hellowood/dynamicdatasource/configuration/CustomHandlerExceptionResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
/**
2020
* Custom exception handler
2121
*
22-
* @Date 2017-07-11 21:03
23-
* @Author HelloWood
22+
* @author HelloWood
23+
* @date 2017-07-11 21:03
2424
* @Email hellowoodes@gmail.com
2525
*/
2626
public class CustomHandlerExceptionResolver implements HandlerExceptionResolver {

src/main/java/cn/com/hellowood/dynamicdatasource/configuration/DynamicDataSourceAspect.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
/**
1313
* Multiple DataSource Aspect
1414
*
15-
* @Date 2017-08-15 11:37
16-
* @Author HelloWood
17-
* @Email hellowoodes@gmail.com
15+
* @author HelloWood
16+
* @date 2017-08-15 11:37
17+
* @email hellowoodes@gmail.com
1818
*/
1919
@Aspect
2020
@Order(-1) // To ensure execute before @Transactional
@@ -31,13 +31,11 @@ public class DynamicDataSourceAspect {
3131
@Before("@annotation(targetDataSource))")
3232
public void switchDataSource(JoinPoint point, TargetDataSource targetDataSource) {
3333
if (!DynamicDataSourceContextHolder.containDataSourceKey(targetDataSource.value())) {
34-
logger.error("DataSource [{}] doesn't exist, use default DataSource [{}]",
35-
targetDataSource.value(), point.getSignature());
34+
logger.error("DataSource [{}] doesn't exist, use default DataSource [{}]", targetDataSource.value());
3635
} else {
37-
logger.info("Current DataSource is [{}]", DynamicDataSourceContextHolder.getDataSourceKey());
38-
logger.info("Switch DataSource to [{}] in Method [{}]",
39-
targetDataSource.value(), point.getSignature());
4036
DynamicDataSourceContextHolder.setDataSourceKey(targetDataSource.value());
37+
logger.info("Switch DataSource to [{}] in Method [{}]",
38+
DynamicDataSourceContextHolder.getDataSourceKey(), point.getSignature());
4139
}
4240
}
4341

@@ -49,9 +47,9 @@ public void switchDataSource(JoinPoint point, TargetDataSource targetDataSource)
4947
*/
5048
@After("@annotation(targetDataSource))")
5149
public void restoreDataSource(JoinPoint point, TargetDataSource targetDataSource) {
52-
logger.info("Restore DataSource to [{}] in Method [{}]",
53-
targetDataSource.value(), point.getSignature());
5450
DynamicDataSourceContextHolder.clearDataSourceKey();
51+
logger.info("Restore DataSource to [{}] in Method [{}]",
52+
DynamicDataSourceContextHolder.getDataSourceKey(), point.getSignature());
5553
}
5654

5755
}

src/main/java/cn/com/hellowood/dynamicdatasource/configuration/DynamicRoutingDataSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
/**
88
* Multiple DataSource Configurer
99
*
10-
* @Date 2017-08-15 11:37
11-
* @Author HelloWood
10+
* @author HelloWood
11+
* @date 2017-08-15 11:37
1212
* @Email hellowoodes@gmail.com
1313
*/
1414

src/main/java/cn/com/hellowood/dynamicdatasource/configuration/TargetDataSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/**
66
* Multiple DataSource Aspect For Switch DataSource
77
*
8-
* @Date 2017-08-15 14:36
9-
* @Author HelloWood
8+
* @author HelloWood
9+
* @date 2017-08-15 14:36
1010
* @Email hellowoodes@gmail.com
1111
*/
1212
@Target({ElementType.METHOD, ElementType.TYPE})

src/main/java/cn/com/hellowood/dynamicdatasource/configuration/WebMvcConfigurer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
/**
1313
* Config for application
1414
*
15-
* @Date 2017-07-11 21:35
16-
* @Author HelloWood
15+
* @author HelloWood
16+
* @date 2017-07-11 21:35
1717
* @Email hellowoodes@gmail.com
1818
*/
1919

src/main/java/cn/com/hellowood/dynamicdatasource/controller/BaseController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
/**
99
* Base controller
1010
*
11-
* @Date 2017-09-25 13:31
12-
* @Author HelloWood
11+
* @author HelloWood
12+
* @date 2017-09-25 13:31
1313
* @Email hellowoodes@gmail.com
1414
*/
1515

0 commit comments

Comments
 (0)