|
|
@@ -15,12 +15,14 @@ import org.aspectj.lang.annotation.After;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
|
import org.aspectj.lang.annotation.Pointcut;
|
|
|
+import org.aspectj.lang.reflect.MethodSignature;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.servlet.HandlerInterceptor;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.lang.reflect.Method;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
@@ -103,6 +105,20 @@ public class ServiceAspect implements HandlerInterceptor {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
|
|
+//
|
|
|
+// // 获取当前类名
|
|
|
+// String className = signature.getDeclaringTypeName();
|
|
|
+// String methodName = "getPrimaryKey";
|
|
|
+// Class clz = Class.forName(className);
|
|
|
+// Object obj = clz.newInstance();
|
|
|
+// //获取方法
|
|
|
+// Method m = obj.getClass().getDeclaredMethod(methodName);
|
|
|
+// //调用方法
|
|
|
+// String primaryKey = (String) m.invoke(obj);
|
|
|
+
|
|
|
+ /* 从请求头中获取主键Id,用于用Id进行查询的是否加入语言和公司 */
|
|
|
+ MybatisSqlIntercept.primaryKey = httpServletRequest.getHeader("primaryKey");
|
|
|
/* 从请求头中获取国际化参数 */
|
|
|
MybatisSqlIntercept.I18N = httpServletRequest.getHeader("i18n");
|
|
|
|