| | |
| | | @Autowired |
| | | private OperateLogService operateLogService; |
| | | |
| | | @Pointcut("execution(* com.zy.asrs.controller..*.*(..))") |
| | | @Pointcut("execution(* com.zy.asrs.controller.*(..))") |
| | | private void webLog() { |
| | | } |
| | | |
| | |
| | | "||@within(org.springframework.stereotype.Controller)") |
| | | public Object after(ProceedingJoinPoint joinPoint) throws Throwable{ |
| | | ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | if(requestAttributes != null){ |
| | | return joinPoint.proceed(); |
| | | } |
| | | HttpServletRequest request = requestAttributes.getRequest(); |
| | | long start = System.currentTimeMillis(); |
| | | Object result = joinPoint.proceed(joinPoint.getArgs()); |
| | |
| | | operateLog.setRequest(JSONObject.toJSONString(filterArgs(joinPoint.getArgs()))); |
| | | operateLog.setResponse(JSONObject.toJSONString(result)); |
| | | operateLogService.insert(operateLog); |
| | | request.setAttribute("operateLog", operateLog); |
| | | } |
| | | |
| | | } |