pull/4077/head
zhangdaiscott 2022-09-29 13:49:46 +08:00
commit 5c00114d7c
2 changed files with 10 additions and 1 deletions

View File

@ -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);

View File

@ -157,6 +157,9 @@ public class SentinelConfig {
if(StringUtils.isNotBlank(nacosConfigProperties.getPassword())){ if(StringUtils.isNotBlank(nacosConfigProperties.getPassword())){
properties.put(PropertyKeyConst.PASSWORD,nacosConfigProperties.getPassword()); properties.put(PropertyKeyConst.PASSWORD,nacosConfigProperties.getPassword());
} }
if(StringUtils.isNotBlank(nacosConfigProperties.getNamespace())){
properties.put(PropertyKeyConst.NAMESPACE,nacosConfigProperties.getNamespace());
}
return ConfigFactory.createConfigService(properties); return ConfigFactory.createConfigService(properties);
} }
} }