|
|
|
|
@ -5,19 +5,15 @@ import org.aspectj.lang.annotation.Aspect;
|
|
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
@Aspect
|
|
|
|
|
@Component
|
|
|
|
|
public class Log {
|
|
|
|
|
|
|
|
|
|
@Before("execution(* com.ssm.aop.Class.show())")
|
|
|
|
|
public void beforeClassAdvice(){
|
|
|
|
|
System.out.println("【前置通知】Class方法即将执行");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Before("execution(* com.ssm.aop.Exam.show())")
|
|
|
|
|
public void beforeExamAdvice(JoinPoint jp){
|
|
|
|
|
System.out.println("=====组员Exam模块日志=====");
|
|
|
|
|
System.out.println("即将执行的方法:" + jp.getSignature().getName());
|
|
|
|
|
System.out.println("==========================");
|
|
|
|
|
public void before(JoinPoint jp) {
|
|
|
|
|
System.out.println("==================================");
|
|
|
|
|
System.out.println("【前置通知】开始执行方法:" + jp.getSignature().getName());
|
|
|
|
|
System.out.println("【前置通知】执行时间:" + new Date());
|
|
|
|
|
System.out.println("==================================");
|
|
|
|
|
}
|
|
|
|
|
}
|