Commit 2ddebc2d authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/master'

parents 68af9ca2 4e647f39
......@@ -3,9 +3,7 @@ package com.github.wxiaoqi.security.common.log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.log.CommonLogService;
import com.github.wxiaoqi.security.common.log.entity.XxLogEntity;
import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -16,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -36,7 +33,7 @@ public class XxLogInterceptor{
CommonLogService commonLogService;
//触发条件为:com.xxfc.platform包下面所有controller
@Around("within(com.xxfc.platform.*.rest..* || com.xxfc.platform.*.controller..*)")
@Around("within(com.xxfc.platform.*.rest..* || com.xxfc.platform.*.controller..* || com.github.wxiaoqi.security.admin.rest..* || com.github.wxiaoqi.security.admin.rest..*)")
public Object doAroundXxControllerLog(ProceedingJoinPoint pjp) throws Throwable {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = servletRequestAttributes.getRequest();//获取request
......@@ -60,6 +57,7 @@ public class XxLogInterceptor{
try{
//###################上面代码为方法执行前#####################
result = pjp.proceed();//执行方法,获取返回参数
log.info("接口调用返回:{}", xxLogEntity.toString());
//###################下面代码为方法执行后#####################
if(result instanceof JSONObject) {
commonLogService.initCommonLogLastPart(xxLogEntity, ((JSONObject) result).toJSONString());
......
......@@ -23,7 +23,10 @@ import tk.mybatis.spring.annotation.MapperScan;
*/
@EnableDiscoveryClient
@EnableCircuitBreaker
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {
"com.github.wxiaoqi.security.common.log",
"com.github.wxiaoqi.security.admin"
})
@EnableFeignClients(value = {"com.github.wxiaoqi.security","com.xxfc.platform"},defaultConfiguration = HeaderConfig.class)
@EnableScheduling
@EnableAceAuthClient
......
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