From 24e341d1cf880e2e9e119acdc25a81b2fa39ba4f Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 14 Oct 2022 15:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hihidata/datasource/server/DatasourceOperation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fanruan/hihidata/datasource/server/DatasourceOperation.java b/src/main/java/com/fanruan/hihidata/datasource/server/DatasourceOperation.java index d600c93..77a8d60 100644 --- a/src/main/java/com/fanruan/hihidata/datasource/server/DatasourceOperation.java +++ b/src/main/java/com/fanruan/hihidata/datasource/server/DatasourceOperation.java @@ -138,12 +138,14 @@ public class DatasourceOperation { * 修改已有的数据源表的名字 * @param tableId 数据源表Id * @param newTableName 新的数据源表名字 + * @param replaceOldData 是否后续的数据是替换原数据的,true表示替换原数据,false表示在原数据之后追加 * @throws Exception 操作失败则抛出此异常 */ - public void modifyTable(String tableId, String newTableName) throws Exception { + public void modifyTable(String tableId, String newTableName, boolean replaceOldData) throws Exception { JSONObject body = new JSONObject(); body.put("tableId", tableId); body.put("tableName", newTableName); + body.put("increase", !replaceOldData); HttpEntity entity = new StringEntity(body.toString(), StandardCharsets.UTF_8); HttpKits.post(String.format("%s/api/v1/datasource/table/modify", ProjectConstants.BASE_URI), headers(), entity); }