Browse Source

默认值

master
richie 5 years ago
parent
commit
a8ea4882a8
  1. 3
      plugin.xml
  2. 3
      src/main/java/com/fr/plugin/db/es/fun/category/impl/JSONResultStandardize.java

3
plugin.xml

@ -3,12 +3,13 @@
<id>com.fr.plugin.db.es.v10</id> <id>com.fr.plugin.db.es.v10</id>
<name><![CDATA[Elasticsearch数据集]]></name> <name><![CDATA[Elasticsearch数据集]]></name>
<active>yes</active> <active>yes</active>
<version>1.4</version> <version>1.5</version>
<env-version>10.0</env-version> <env-version>10.0</env-version>
<jartime>2019-10-25</jartime> <jartime>2019-10-25</jartime>
<vendor>fanruan.richie</vendor> <vendor>fanruan.richie</vendor>
<description><![CDATA[Elasticsearch数据查询。]]></description> <description><![CDATA[Elasticsearch数据查询。]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
[2020-03-18]默认使用$..*查询语句获取所有值。<br/>
[2020-03-11]新增查询请求类型。<br/> [2020-03-11]新增查询请求类型。<br/>
[2020-03-07]远程设计序列化问题。<br/> [2020-03-07]远程设计序列化问题。<br/>
[2020-01-07]修复一个写xml的错误。<br/> [2020-01-07]修复一个写xml的错误。<br/>

3
src/main/java/com/fr/plugin/db/es/fun/category/impl/JSONResultStandardize.java

@ -1,5 +1,6 @@
package com.fr.plugin.db.es.fun.category.impl; package com.fr.plugin.db.es.fun.category.impl;
import com.fanruan.api.util.StringKit;
import com.fr.plugin.db.es.fun.ConfigAttribute; import com.fr.plugin.db.es.fun.ConfigAttribute;
import com.fr.plugin.db.es.fun.assist.SimpleDataModel; import com.fr.plugin.db.es.fun.assist.SimpleDataModel;
import com.fr.plugin.db.es.fun.category.ResultStandardize; import com.fr.plugin.db.es.fun.category.ResultStandardize;
@ -28,7 +29,7 @@ public class JSONResultStandardize implements ResultStandardize {
@Override @Override
public SimpleDataModel result(String text, String script, ConfigAttribute configAttribute, int rowCount) { public SimpleDataModel result(String text, String script, ConfigAttribute configAttribute, int rowCount) {
Object object = JsonPath.read(text, script); Object object = JsonPath.read(text, StringKit.isBlank(script) ? "$..*" : script);
if (object instanceof LinkedHashMap) { if (object instanceof LinkedHashMap) {
initJSONObject(new TreeMap<>((LinkedHashMap<String, Object>) object)); initJSONObject(new TreeMap<>((LinkedHashMap<String, Object>) object));
} else if (object instanceof JSONArray) { } else if (object instanceof JSONArray) {

Loading…
Cancel
Save