我想以不同的方式记录 Controller 和其他包。我知道我可以为此使用 2 种单独的方法,但是这 2 种方法非常相似,所以我想添加一个代码来检查它看起来像这样
@Around("controllerPoint() || theRest()")
public Object log(ProceedingJoinPoint joinPoint) throws Throwable {
if( called from controllerPoint() ) {
execute this short section of code # (1)
}
// rest of code
这段代码会是什么样子?
另外,如果在执行 (1) 之后,我想在为其他包执行时再次将变量传递给相同的方法,我该怎么做?