style: 属性 dsCache 放在类的开始位置。

This commit is contained in:
Suomm 2023-06-28 10:09:02 +08:00
parent 6185b433e1
commit af718a6cff

View File

@ -36,6 +36,11 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class DataSourceInterceptor implements MethodInterceptor {
/**
* 缓存方法对应的数据源
*/
private final Map<Object, String> dsCache = new ConcurrentHashMap<>();
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
@ -57,11 +62,6 @@ public class DataSourceInterceptor implements MethodInterceptor {
}
}
/**
* 缓存方法对应的数据源
*/
private final Map<Object, String> dsCache = new ConcurrentHashMap<>();
private String findDataSourceKey(Method method, Class<?> targetClass) {
Object cacheKey = new MethodClassKey(method, targetClass);
String dsKey = this.dsCache.get(cacheKey);