打日志
This commit is contained in:
parent
753ca35894
commit
a0ce911a58
@ -60,6 +60,15 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isNotSqlTest() {
|
||||
try {
|
||||
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
||||
return request.getParameter("qqq") == null;
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) {
|
||||
PluginUtils.MPStatementHandler mpSh = PluginUtils.mpStatementHandler(sh);
|
||||
MappedStatement ms = mpSh.mappedStatement();
|
||||
@ -99,6 +108,7 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte
|
||||
Method[] declaredMethods = clazz.getDeclaredMethods();
|
||||
Optional<DataScope> dsOption = Arrays.stream(declaredMethods).filter(method -> method.getName().equals(methodName)).map(method -> method.getAnnotation(DataScope.class)).filter(Objects::nonNull).findFirst();
|
||||
annotation = dsOption.orElseGet(() -> clazz.getAnnotation(DataScope.class));
|
||||
log.debug("执行mapper方法: {} # {}", clazz.getName(), methodName);
|
||||
if (findIgnoreDataScope(parameter, annotation) && isNotSqlTest()) {
|
||||
return;
|
||||
}
|
||||
@ -112,15 +122,6 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isNotSqlTest() {
|
||||
try {
|
||||
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
||||
return request.getParameter("qqq") == null;
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected void processSelect(Select select, int index, String sql, Object obj) {
|
||||
this.processSelectBody(select.getSelectBody(), obj);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user