You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.4 KiB
31 lines
1.4 KiB
package com.ssm.aop;
|
|
|
|
import org.aspectj.lang.JoinPoint;
|
|
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 {
|
|
public void before(JoinPoint joinPoint) {
|
|
System.out.println("==================================");
|
|
System.out.println("【前置通知】开始执行的方法 " + joinPoint.getSignature().getName() );
|
|
System.out.println("【前置通知】执行时间 " + new Date());
|
|
System.out.println("==================================");
|
|
}
|
|
public void before(JoinPoint joinPoint, Course course) {
|
|
System.out.println("==================================");
|
|
System.out.println("【前置通知】开始执行的方法 " + joinPoint.getSignature().getName() );
|
|
System.out.println("【前置通知】执行时间 " + new Date());
|
|
System.out.println("==================================");
|
|
}
|
|
public void before(JoinPoint joinPoint, Score score) {
|
|
System.out.println("==================================");
|
|
System.out.println("【前置通知】开始执行的方法 " + joinPoint.getSignature().getName() );
|
|
System.out.println("【前置通知】执行时间 " + new Date());
|
|
System.out.println("==================================");
|
|
}
|
|
} |