Merge pull request #7886 from dataease/pr@dev@fixExcel

fix(数据源): 修复创建API数据源失败
This commit is contained in:
taojinlong 2024-01-29 18:28:17 +08:00 committed by GitHub
commit 749294f6a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -11,9 +11,11 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import io.dataease.commons.utils.CommonBeanFactory;
import io.dataease.dto.dataset.DatasetTableFieldDTO;
import io.dataease.plugins.common.dto.datasource.TableDesc;
import io.dataease.plugins.common.dto.datasource.TableField;
import io.dataease.plugins.common.exception.DataEaseException;
import io.dataease.plugins.common.request.datasource.DatasourceRequest;
import io.dataease.plugins.datasource.entity.Status;
import io.dataease.plugins.datasource.provider.Provider;
@ -245,9 +247,9 @@ public class ApiProvider extends Provider {
rootPath = "$[*]";
JsonNode jsonArray = null;
try {
jsonArray = new ObjectMapper().readTree(response);
jsonArray = CommonBeanFactory.getBean(ObjectMapper.class).readTree(response);
} catch (Exception e) {
e.printStackTrace();
DataEaseException.throwException(e.getMessage());
}
for (Object o : jsonArray) {
handleStr(apiDefinition, o.toString(), fields, rootPath);

View File

@ -1620,7 +1620,7 @@ public class EsQueryProvider extends QueryProvider {
"{\"dateformat\": \"yyyy/MMdd\"},\n" +
"{\"dateformat\": \"yyyy-MM-dd\"},\n" +
"{\"dateformat\": \"yyyyMMdd HH:mm:ss\"},\n" +
"{\"dateformat\": \"yyyy/MMdd HH:mm:ss\"},\n" +
"{\"dateformat\": \"yyyy/MM/dd HH:mm:ss\"},\n" +
"{\"dateformat\": \"yyyy-MM-dd HH:mm:ss\"}\n" +
"]", Dateformat.class);
}

View File

@ -80,6 +80,7 @@ server.compression.min-response-size=1024
server.servlet.context-parameters.configurationStrategy=SYSTEM_PROPERTIES
server.servlet.session.cookie.http-only=true
server.servlet.session.tracking-modes=cookie
spring.jackson.parser.allow-numeric-leading-zeros=true