diff --git a/core/core-backend/src/main/java/io/gisbi/dataset/server/DatasetDataServer.java b/core/core-backend/src/main/java/io/gisbi/dataset/server/DatasetDataServer.java index be61649..c438bda 100644 --- a/core/core-backend/src/main/java/io/gisbi/dataset/server/DatasetDataServer.java +++ b/core/core-backend/src/main/java/io/gisbi/dataset/server/DatasetDataServer.java @@ -1,15 +1,21 @@ package io.gisbi.dataset.server; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.gisbi.api.dataset.DatasetDataApi; -import io.gisbi.api.dataset.dto.*; +import io.gisbi.api.dataset.dto.BaseTreeNodeDTO; +import io.gisbi.api.dataset.dto.EnumValueRequest; +import io.gisbi.api.dataset.dto.MultFieldValuesRequest; +import io.gisbi.api.dataset.dto.PreviewSqlDTO; import io.gisbi.api.dataset.union.DatasetGroupInfoDTO; +import io.gisbi.api.dataset.dto.EnumObj; +import io.gisbi.dataset.dao.auto.entity.CoreDatasetTable; +import io.gisbi.dataset.dao.auto.entity.CoreDatasetTableField; import io.gisbi.dataset.manage.DatasetDataManage; import io.gisbi.extensions.datasource.dto.DatasetTableDTO; import io.gisbi.extensions.datasource.dto.DatasetTableFieldDTO; import io.gisbi.utils.LogUtil; import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; @@ -96,4 +102,56 @@ public class DatasetDataServer implements DatasetDataApi { return null; } } + + @GetMapping("getTablesByAppId") + public List> getTablesByAppId(String appid) throws Exception { + List> result = datasetDataManage.getTablesByAppId(appid); + return result; + } + @GetMapping("getFieldsByTableId") + public Map getFieldsByTableId(Long datasourceId,String tablename) throws Exception { + Map result = datasetDataManage.getFieldsByTableId(datasourceId,tablename); + return result; + } + @PostMapping("addTableData") + public boolean addTableData(Long datasourceId, @RequestParam("tableData") String tableData) throws Exception { + boolean result = datasetDataManage.addTableData( + datasourceId, + tableData + ); + return result; + } + + @PostMapping("getTableDataByPk") + public Map getTableDataByPk(Long datasourceId,@RequestParam("whereJson") String whereJson) throws Exception { + Map result=datasetDataManage.getTableDataByPk( + datasourceId, + whereJson + ); + return result; + } + @PostMapping("updateTableData") + public boolean updateTableData(Long datasourceId, @RequestParam("tableData") String tableData) throws Exception { + boolean result = datasetDataManage.updateTableData( + datasourceId, + tableData + ); + return result; + } + @PostMapping("deleteTableData") + public boolean deleteTableData(Long datasourceId, @RequestParam("whereJson") String whereJson) throws Exception { + boolean result = datasetDataManage.deleteTableData( + datasourceId, + whereJson + ); + return result; + } + @PostMapping("queryTableDataPaged") + public Page> queryTableDataPaged(Long datasourceId, @RequestParam("queryJson") String queryJson) throws Exception { + Page> result = datasetDataManage.queryTableDataPaged( + datasourceId, + queryJson + ); + return result; + } }