use of com.vip.saturn.job.console.aop.annotation.AuditParam in project Saturn by vipshop.
the class AuditLogAspect method addAuditParamsIfPossible.
private void addAuditParamsIfPossible(ProceedingJoinPoint joinPoint) {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Annotation[][] annotations = signature.getMethod().getParameterAnnotations();
int i = 0;
for (Object arg : joinPoint.getArgs()) {
for (Annotation annotation : annotations[i]) {
if (annotation.annotationType() == AuditParam.class) {
AuditParam auditParamAnno = (AuditParam) annotation;
String value = auditParamAnno.value();
if (value != null) {
AuditInfoContext.put(value, arg == null ? null : arg.toString());
}
}
}
i++;
}
}
Aggregations