|
|
@ -25,7 +25,10 @@ public class DatasourceOperation { |
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
body.put("status", "1"); |
|
|
|
body.put("status", "1"); |
|
|
|
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/status/modify", ProjectConstants.BASE_URI), headers(), entity); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
|
|
|
|
params.put("status", "1"); |
|
|
|
|
|
|
|
String r = HttpKits.post(String.format("%s/api/v1/datasource/status/modify", ProjectConstants.BASE_URI), headers(), params); |
|
|
|
|
|
|
|
System.out.println("result=" + r); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void createGroup(String groupName) throws Exception { |
|
|
|
public void createGroup(String groupName) throws Exception { |
|
|
@ -35,6 +38,15 @@ public class DatasourceOperation { |
|
|
|
HttpKits.post(String.format("%s/api/v1/datasource/group/create", ProjectConstants.BASE_URI), headers(), entity); |
|
|
|
HttpKits.post(String.format("%s/api/v1/datasource/group/create", ProjectConstants.BASE_URI), headers(), entity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String createTable(String tableName) throws Exception { |
|
|
|
|
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
|
|
|
|
body.put("tableName", tableName); |
|
|
|
|
|
|
|
HttpEntity entity = new StringEntity(body.toString(), StandardCharsets.UTF_8); |
|
|
|
|
|
|
|
String res = HttpKits.post(String.format("%s/api/v1/datasource/table/create", ProjectConstants.BASE_URI), headers(), entity); |
|
|
|
|
|
|
|
JSONObject data = new JSONObject(res); |
|
|
|
|
|
|
|
return data.getString("data"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String createTable(String tableName, String groupName) throws Exception { |
|
|
|
public String createTable(String tableName, String groupName) throws Exception { |
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
body.put("name", tableName); |
|
|
|
body.put("name", tableName); |
|
|
@ -47,7 +59,9 @@ public class DatasourceOperation { |
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
body.put("tableId", tableId); |
|
|
|
body.put("tableId", tableId); |
|
|
|
HttpEntity entity = new StringEntity(body.toString(), StandardCharsets.UTF_8); |
|
|
|
HttpEntity entity = new StringEntity(body.toString(), StandardCharsets.UTF_8); |
|
|
|
return HttpKits.post(String.format("%s/api/v1/datasource/table/upload/url", ProjectConstants.BASE_URI), headers(), entity); |
|
|
|
String res = HttpKits.post(String.format("%s/api/v1/datasource/table/upload/url", ProjectConstants.BASE_URI), headers(), entity); |
|
|
|
|
|
|
|
JSONObject data = new JSONObject(res); |
|
|
|
|
|
|
|
return data.getString("data"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void markAsFinish(String tableId) throws Exception { |
|
|
|
public void markAsFinish(String tableId) throws Exception { |
|
|
|