|
@@ -2,21 +2,19 @@ package org.dromara.common.mybatis.aspect;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
|
|
-import org.springframework.aop.support.DynamicMethodMatcher;
|
|
|
|
|
|
|
+import org.springframework.aop.support.StaticMethodMatcherPointcut;
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Method;
|
|
|
import java.lang.reflect.Proxy;
|
|
import java.lang.reflect.Proxy;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 数据权限动态方法匹配器
|
|
|
|
|
|
|
+ * 数据权限匹配切点
|
|
|
*
|
|
*
|
|
|
* @author 秋辞未寒
|
|
* @author 秋辞未寒
|
|
|
*/
|
|
*/
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@SuppressWarnings("all")
|
|
@SuppressWarnings("all")
|
|
|
-public class DataPermissionDynamicMethodMatcher extends DynamicMethodMatcher {
|
|
|
|
|
-
|
|
|
|
|
- public DataPermissionDynamicMethodMatcher() {}
|
|
|
|
|
|
|
+public class DataPermissionPointcut extends StaticMethodMatcherPointcut {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean matches(Method method, Class<?> targetClass) {
|
|
public boolean matches(Method method, Class<?> targetClass) {
|
|
@@ -38,9 +36,4 @@ public class DataPermissionDynamicMethodMatcher extends DynamicMethodMatcher {
|
|
|
return targetClassRef.isAnnotationPresent(DataPermission.class);
|
|
return targetClassRef.isAnnotationPresent(DataPermission.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean matches(Method method, Class<?> targetClass, Object... args) {
|
|
|
|
|
- return matches(method, targetClass);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|