提交 4d3e2012 authored 作者: junjie's avatar junjie

feat(backend):数据集、视图详情接口

上级 924f6396
...@@ -44,4 +44,9 @@ public class ChartViewController { ...@@ -44,4 +44,9 @@ public class ChartViewController {
public ChartViewDTO getData(@PathVariable String id) throws Exception { public ChartViewDTO getData(@PathVariable String id) throws Exception {
return chartViewService.getData(id); return chartViewService.getData(id);
} }
@PostMapping("chartDetail/{id}")
public Map<String, Object> chartDetail(@PathVariable String id) {
return chartViewService.getChartDetail(id);
}
} }
...@@ -82,4 +82,8 @@ public class DataSetTableController { ...@@ -82,4 +82,8 @@ public class DataSetTableController {
dataSetTableService.saveIncrementalConfig(datasetTableIncrementalConfig); dataSetTableService.saveIncrementalConfig(datasetTableIncrementalConfig);
} }
@PostMapping("datasetDetail/{id}")
public Map<String, Object> datasetDetail(@PathVariable String id) {
return dataSetTableService.getDatasetDetail(id);
}
} }
...@@ -20,6 +20,7 @@ import io.dataease.service.dataset.DataSetTableFieldsService; ...@@ -20,6 +20,7 @@ import io.dataease.service.dataset.DataSetTableFieldsService;
import io.dataease.service.dataset.DataSetTableService; import io.dataease.service.dataset.DataSetTableService;
import io.dataease.service.spark.SparkCalc; import io.dataease.service.spark.SparkCalc;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -249,4 +250,15 @@ public class ChartViewService { ...@@ -249,4 +250,15 @@ public class ChartViewService {
throw new RuntimeException("Name can't repeat in same group."); throw new RuntimeException("Name can't repeat in same group.");
} }
} }
public Map<String, Object> getChartDetail(String id) {
Map<String, Object> map = new HashMap<>();
ChartViewWithBLOBs chartViewWithBLOBs = chartViewMapper.selectByPrimaryKey(id);
map.put("chart", chartViewWithBLOBs);
if (ObjectUtils.isNotEmpty(chartViewWithBLOBs)) {
Map<String, Object> datasetDetail = dataSetTableService.getDatasetDetail(chartViewWithBLOBs.getTableId());
map.putAll(datasetDetail);
}
return map;
}
} }
...@@ -16,6 +16,7 @@ import io.dataease.datasource.provider.ProviderFactory; ...@@ -16,6 +16,7 @@ import io.dataease.datasource.provider.ProviderFactory;
import io.dataease.datasource.request.DatasourceRequest; import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.dto.dataset.DataTableInfoDTO; import io.dataease.dto.dataset.DataTableInfoDTO;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -422,4 +423,15 @@ public class DataSetTableService { ...@@ -422,4 +423,15 @@ public class DataSetTableService {
throw new RuntimeException("Name can't repeat in same group."); throw new RuntimeException("Name can't repeat in same group.");
} }
} }
public Map<String, Object> getDatasetDetail(String id) {
Map<String, Object> map = new HashMap<>();
DatasetTable table = datasetTableMapper.selectByPrimaryKey(id);
map.put("table", table);
if (ObjectUtils.isNotEmpty(table)) {
Datasource datasource = datasourceMapper.selectByPrimaryKey(table.getDataSourceId());
map.put("datasource", datasource);
}
return map;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论