RED-161: reverse caseSensitive
This commit is contained in:
parent
c8375a1ad9
commit
3eb37fa6db
@ -39,7 +39,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.iqser.red.service</groupId>
|
<groupId>com.iqser.red.service</groupId>
|
||||||
<artifactId>configuration-service-api-v1</artifactId>
|
<artifactId>configuration-service-api-v1</artifactId>
|
||||||
<version>1.0.5.1</version>
|
<version>1.0.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
|
|||||||
@ -38,7 +38,8 @@ public class DictionaryService {
|
|||||||
private List<String> hintTypes = new ArrayList<>();
|
private List<String> hintTypes = new ArrayList<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private List<String> caseSensitiveTypes = new ArrayList<>();
|
private List<String> caseInsensitiveTypes = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
public void updateDictionary() {
|
public void updateDictionary() {
|
||||||
|
|
||||||
@ -49,18 +50,36 @@ public class DictionaryService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateDictionaryEntry() {
|
private void updateDictionaryEntry() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TypeResponse typeResponse = dictionaryClient.getAllTypes();
|
TypeResponse typeResponse = dictionaryClient.getAllTypes();
|
||||||
if (typeResponse != null && !CollectionUtils.isEmpty(typeResponse.getTypes())) {
|
if (typeResponse != null && !CollectionUtils.isEmpty(typeResponse.getTypes())) {
|
||||||
entryColors = typeResponse.getTypes().stream().collect(Collectors.toMap(TypeResult::getType, TypeResult::getColor));
|
entryColors = typeResponse.getTypes()
|
||||||
dictionary = entryColors.keySet().stream().collect(Collectors.toMap(type -> type, s -> dictionaryClient.getDictionaryForType(s).getEntries().stream().collect(Collectors.toSet())));
|
.stream()
|
||||||
hintTypes = typeResponse.getTypes().stream().filter(TypeResult::isHint).map(TypeResult::getType).collect(Collectors.toList());
|
.collect(Collectors.toMap(TypeResult::getType, TypeResult::getColor));
|
||||||
caseSensitiveTypes = typeResponse.getTypes().stream().filter(TypeResult::isCaseSensitive).map(TypeResult::getType).collect(Collectors.toList());
|
dictionary = entryColors.keySet()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(type -> type, s -> dictionaryClient.getDictionaryForType(s)
|
||||||
|
.getEntries()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toSet())));
|
||||||
|
hintTypes = typeResponse.getTypes()
|
||||||
|
.stream()
|
||||||
|
.filter(TypeResult::isHint)
|
||||||
|
.map(TypeResult::getType)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
caseInsensitiveTypes = typeResponse.getTypes()
|
||||||
|
.stream()
|
||||||
|
.filter(TypeResult::isCaseInsensitive)
|
||||||
|
.map(TypeResult::getType)
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
} catch (FeignException e) {
|
} catch (FeignException e) {
|
||||||
log.warn("Got some unknown feignException", e);
|
log.warn("Got some unknown feignException", e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ public class AnnotationHighlightService {
|
|||||||
|
|
||||||
private boolean isHint(Entity entity) {
|
private boolean isHint(Entity entity) {
|
||||||
List<String> hintTypes = dictionaryService.getHintTypes();
|
List<String> hintTypes = dictionaryService.getHintTypes();
|
||||||
if (!CollectionUtils.isEmpty(hintTypes) && hintTypes.contains(entity.getType())) {
|
if (CollectionUtils.isNotEmpty(hintTypes) && hintTypes.contains(entity.getType())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user