Pre Merge pull request !1066 from qfuzj/pr

pull/1066/MERGE
qfuzj 2025-12-02 06:57:40 +00:00 committed by Gitee
commit 558210a1a4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 12 additions and 3 deletions

View File

@ -67,6 +67,15 @@ public class DataSourceAspect
return dataSource;
}
return AnnotationUtils.findAnnotation(signature.getDeclaringType(), DataSource.class);
}
}
// 组合检查声明类和目标类
Class<?> declaringType = signature.getDeclaringType();
Class<?> targetClass = point.getTarget().getClass();
DataSource classAnnotation = AnnotationUtils.findAnnotation(targetClass, DataSource.class);
if (classAnnotation == null) {
classAnnotation = AnnotationUtils.findAnnotation(declaringType, DataSource.class);
}
return classAnnotation;
}
}