## Opt - PageUtils.clearPage AOP
This commit is contained in:
parent
f7f995c9c3
commit
0bceaa15d8
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue