love.keeping.starter.web.aop.ControllerAspector Maven / Gradle / Ivy
The newest version!
package love.keeping.starter.web.aop;
import love.keeping.starter.common.utils.ArrayUtil;
import love.keeping.starter.common.utils.CollectionUtil;
import love.keeping.starter.web.utils.JsonUtil;
import java.util.LinkedList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
/**
* Controller切面
*
* @author Keeping
*/
@Aspect
public class ControllerAspector {
@Pointcut("(@within(org.springframework.web.bind.annotation.RestController) || @within(org.springframework.stereotype.Controller)) && execution(public * *(..))")
public void controllerPointCut() {
}
@Around(value = "controllerPointCut()")
public Object logController(ProceedingJoinPoint joinPoint) throws Throwable {
Logger logger = LoggerFactory.getLogger(joinPoint.getTarget().getClass());
Object[] args = joinPoint.getArgs();
List