## Opt - PageUtils.clearPage AOP

This commit is contained in:
sangelxiu1 2025-06-19 17:35:23 +08:00
parent f7f995c9c3
commit 0bceaa15d8
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package com.hzs.common.core.aspect;
import com.hzs.common.core.utils.PageUtils;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Slf4j
public class ControllerPageClearAspect {
@Pointcut(
"@annotation(org.springframework.web.bind.annotation.RequestMapping) || " +
"@annotation(org.springframework.web.bind.annotation.GetMapping) || " +
"@annotation(org.springframework.web.bind.annotation.PostMapping) || " +
"@annotation(org.springframework.web.bind.annotation.PutMapping) || " +
"@annotation(org.springframework.web.bind.annotation.DeleteMapping) || " +
"@annotation(org.springframework.web.bind.annotation.PatchMapping)"
)
public void controllerMethods() {}
@After("controllerMethods()")
public void afterControllerExecution() {
log.info("PageUtils.clearPage...");
PageUtils.clearPage();
}
}