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("=================================="); } }