From abf14fc7ba65887fc989247e317378bc040e4289 Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Wed, 25 Jun 2025 09:57:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=BA=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/server/DatasetDataServer.java | 64 ++++++++++++++++++- 1 file changed, 61 insertions(+), 3 deletions(-) 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; + } }