Fix missing language field. (#2174)

This commit is contained in:
吴晟 Wu Sheng 2019-01-18 08:00:51 +08:00 committed by GitHub
parent 9cda28f054
commit 18ed80bd95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -197,6 +197,8 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
JsonObject properties = GSON.fromJson(propertiesString, JsonObject.class);
if (properties.has(LANGUAGE)) {
serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(properties.get(LANGUAGE).getAsString()));
} else {
serviceInstance.setLanguage(Language.UNKNOWN);
}
if (properties.has(OS_NAME)) {

View File

@ -222,6 +222,8 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO {
JsonObject properties = GSON.fromJson(propertiesString, JsonObject.class);
if (properties.has(LANGUAGE)) {
serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(properties.get(LANGUAGE).getAsString()));
} else {
serviceInstance.setLanguage(Language.UNKNOWN);
}
if (properties.has(OS_NAME)) {