Merge pull request #4015 from wang1223440313/master

【修复+优化】系统字典数据应该包括自定义的java类-枚举,扫描全部类修改为只扫描枚举类
pull/4077/head
JEECG 2 years ago committed by GitHub
commit 394c0e2caf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,6 +36,12 @@ public class ResourceUtil {
*/ */
private final static String CLASS_PATTERN="/**/*.class"; private final static String CLASS_PATTERN="/**/*.class";
/**
* java
*/
private final static String CLASS_ENMU_PATTERN="/**/*Enum.class";
/** /**
* org.jeecg * org.jeecg
*/ */
@ -55,7 +61,7 @@ public class ResourceUtil {
return enumDictData; return enumDictData;
} }
ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver(); ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
String pattern = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath(BASE_PACKAGE) + CLASS_PATTERN; String pattern = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath(BASE_PACKAGE) + CLASS_ENMU_PATTERN;
try { try {
Resource[] resources = resourcePatternResolver.getResources(pattern); Resource[] resources = resourcePatternResolver.getResources(pattern);
MetadataReaderFactory readerFactory = new CachingMetadataReaderFactory(resourcePatternResolver); MetadataReaderFactory readerFactory = new CachingMetadataReaderFactory(resourcePatternResolver);

Loading…
Cancel
Save