我有方法
Mono<ReceiptResponse> a01(Mono<DefaultBeneficiaryBankRequest> request)
和方面
@Around("callAtMyServiceSecurityAnnotation(request)")
@Order(1)
public Object scheduleTimeout(ProceedingJoinPoint joinPoint, Mono<?> request) {
Mono<?> retVal = (Mono)joinPoint.proceed();
return retVal.doOnSuccess(i -> {
...
someMethod(<request.value>)// <-- How I can get requets value here?
...
});
}
如何获得请求值作为someMethod的参数?
你的问题中的信息并不完整,但在我看来,你的pointcut callAtMyServiceSecurityAnnotation(request)
已经捕捉到了请求,并将其转发给您的建议方法,作为 Mono<?> request
参数。所以你的问题的答案很简单。只要用 request
以获得对请求参数的访问。
你没有展示你的实际pointcut,但假设是这样的(未经测试,写的只是freestyle,因为我没有你的测试用例可以试一试
@Pointcut("within(my.package.MyTargetClass) && execution(* a01(*)) && args(request)")
public void callAtMyServiceSecurityAnnotation(Mono<?> request) {}
它应该只是工作。