Browse Source

修改文档说明

master
richie 2 years ago
parent
commit
24e341d1cf
  1. 4
      src/main/java/com/fanruan/hihidata/datasource/server/DatasourceOperation.java

4
src/main/java/com/fanruan/hihidata/datasource/server/DatasourceOperation.java

@ -138,12 +138,14 @@ public class DatasourceOperation {
* 修改已有的数据源表的名字 * 修改已有的数据源表的名字
* @param tableId 数据源表Id * @param tableId 数据源表Id
* @param newTableName 新的数据源表名字 * @param newTableName 新的数据源表名字
* @param replaceOldData 是否后续的数据是替换原数据的true表示替换原数据false表示在原数据之后追加
* @throws Exception 操作失败则抛出此异常 * @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(); JSONObject body = new JSONObject();
body.put("tableId", tableId); body.put("tableId", tableId);
body.put("tableName", newTableName); body.put("tableName", newTableName);
body.put("increase", !replaceOldData);
HttpEntity entity = new StringEntity(body.toString(), StandardCharsets.UTF_8); HttpEntity entity = new StringEntity(body.toString(), StandardCharsets.UTF_8);
HttpKits.post(String.format("%s/api/v1/datasource/table/modify", ProjectConstants.BASE_URI), headers(), entity); HttpKits.post(String.format("%s/api/v1/datasource/table/modify", ProjectConstants.BASE_URI), headers(), entity);
} }

Loading…
Cancel
Save