Commit aaa9f24d authored by yanzg's avatar yanzg

检测值

parent 7db17030
...@@ -26,8 +26,13 @@ import org.springframework.stereotype.Component; ...@@ -26,8 +26,13 @@ import org.springframework.stereotype.Component;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse; import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
/** /**
...@@ -208,11 +213,18 @@ public class WebAspect extends AbstractValidateAspect implements ThreadNext.Next ...@@ -208,11 +213,18 @@ public class WebAspect extends AbstractValidateAspect implements ThreadNext.Next
logInterVo.setLogId(StringHelper.getNewID()); logInterVo.setLogId(StringHelper.getNewID());
logInterVo.setLogSources(applicationName);//平台名 logInterVo.setLogSources(applicationName);//平台名
logInterVo.setInterUrl(url);//请求URL logInterVo.setInterUrl(url);//请求URL
Object para = joinPoint.getArgs(); List<Object> para = new ArrayList<>();
if (joinPoint.getArgs().length == 1) { for (Object item : joinPoint.getArgs()) {
para = joinPoint.getArgs()[0]; if (item instanceof HttpServlet || item instanceof HttpServletResponse || item instanceof HttpServletRequest) {
continue;
}
para.add(item);
}
Object paraTo = para;
if (para.size() == 1) {
paraTo = para.get(0);
} }
logInterVo.setContent(JSON.toJSONString(para));//请求参数 logInterVo.setContent(JSON.toJSONString(paraTo));//请求参数
logInterVo.setResult(JSON.toJSONString(responseResult));//返回参数 logInterVo.setResult(JSON.toJSONString(responseResult));//返回参数
logInterVo.setStatus(responseResult.getCode() == ResultConstants.SUCCESS ? 1 : 0); logInterVo.setStatus(responseResult.getCode() == ResultConstants.SUCCESS ? 1 : 0);
return logInterVo; return logInterVo;
...@@ -224,7 +236,7 @@ public class WebAspect extends AbstractValidateAspect implements ThreadNext.Next ...@@ -224,7 +236,7 @@ public class WebAspect extends AbstractValidateAspect implements ThreadNext.Next
* @return 是否继续执行 * @return 是否继续执行
*/ */
@Override @Override
public boolean next() throws Exception { public boolean next() {
while (cache.size() > 0) { while (cache.size() > 0) {
LogVo item = cache.poll(); LogVo item = cache.poll();
if (item != null) { if (item != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment