perf[storage]: 优化提示日志

This commit is contained in:
jaysunxiao committed 2021-07-04 13:59:07 +08:00
1 parent e5cda868e6
commit 646c83d660
4 files changed
+59 -15

No files matched your search

@@ -141,7 +141,7 @@ public class StorageManager implements IStorageManager {
}
if (!keyClazz.getSimpleName().toLowerCase().contains(idFields[0].getType().getSimpleName().toLowerCase())) {
throw new RuntimeException(StringUtils.format("静态类资源[resource:{}]配置注解[id:{}]类型和泛型类型[type:{}]不匹配"
throw new RuntimeException(StringUtils.format("注入静态类配置资源[storage:{}]的[key:{}]类型和泛型类型[type:{}]不匹配"
, resourceClazz.getSimpleName(), idFields[0].getType().getSimpleName(), keyClazz.getSimpleName()));
}
@@ -222,7 +222,7 @@ public class StorageManager implements IStorageManager {
try {
resourceList.addAll(Arrays.asList(resourcePatternResolver.getResources(packageSearchPath)));
} catch (Exception e) {
// do nothing
}
// 通配符无法匹配根目录,所以如果找不到,再从根目录查找一遍
@@ -48,7 +48,9 @@
<storage:storage id="resourceManager">
<storage:scan package="com.zfoo.**.resource"/>
<!-- 如果是类路径一classpath开头,如果是其它目录则以file开头-->
<storage:resource location="classpath:/excel" suffix="xls"/>
<!-- <storage:resource location="file:C:\Users\jaysunxiao\Desktop\excel" suffix="xls"/>-->
</storage:storage>
</beans>