package com.template.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.Arrays;

/**
 * @Author: xwt
 * @Date: 2024/12/18 星期三 14:43
 * @Description: com.template.aop
 * @Version: 1.0
 */
//@Aspect
//@Component
public class LoggingAspect {

    //@Before("execution(* com.template.services.*.*(..))")
    public void logBefore(JoinPoint joinPoint) {
        Object[] args = joinPoint.getArgs();
        System.out.println("Method called: " + joinPoint.getSignature().getName());
        System.out.println("With arguments: " + Arrays.toString(args));
    }
}
