zoukankan      html  css  js  c++  java
  • 切面添加日志

    /**
    日志切面
    */
    @Component
    @Aspect
    @Slf4j
    public class LogAspect {

    @Pointcut("@annotation(com.lwb.a.utils.aLog)")
    public void pointCut() {
    }

    @After(value = "pointCut()")
    public void doCache(JoinPoint joinPoint) {
    //MethodSignature signature = (MethodSignature) joinPoint.getSignature();
    // Method method = signature.getMethod();
    //RmOperationLog annotation = method.getAnnotation(RmOperationLog.class);
    //Object[] args = joinPoint.getArgs();
    try {

    saveLog();
    }catch (Exception e){
    log.error("保存日志切面方法异常,{}",e.getMessage());
    }
    }
    }

    @Target({ElementType.METHOD})
    @Retention(RetentionPolicy.RUNTIME)
    public @interface RmOperationLog {
    String id() default "";
    String ids() default "";
    String operatorName();
    }
    人总得做点什么 ,不是么
  • 相关阅读:
    NOI Online 2020「Prelude」
    CF704E Iron Man
    luogu P4619 [SDOI2018]旧试题
    luogu P4207 [NOI2005]月下柠檬树
    JOI2020
    luogu P3263 [JLOI2015]有意义的字符串
    p1864
    p1824
    p1836
    p1862
  • 原文地址:https://www.cnblogs.com/liweibing/p/14894044.html
Copyright © 2011-2022 走看看