|
|
|
@ -240,6 +240,38 @@ public class DatasourceOperation {
|
|
|
|
|
return data.getJSONArray("data"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取删除数据源数据token |
|
|
|
|
*/ |
|
|
|
|
public JSONArray storeInfo() throws Exception { |
|
|
|
|
String res = HttpKits.post(String.format("%s/api/v1/store/info", ProjectConstants.BASE_URI), headers()); |
|
|
|
|
JSONObject data = new JSONObject(res); |
|
|
|
|
return data.getJSONArray("data"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取删除数据源数据token |
|
|
|
|
*/ |
|
|
|
|
public String dataDeleteApply() throws Exception { |
|
|
|
|
String res = HttpKits.post(String.format("%s/api/v1/store/data/delete/apply", ProjectConstants.BASE_URI), headers()); |
|
|
|
|
JSONObject data = new JSONObject(res); |
|
|
|
|
return data.getString("data"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 删除数据源数据 |
|
|
|
|
*/ |
|
|
|
|
public boolean dataDelete(String token, String storeId) throws Exception { |
|
|
|
|
JSONObject body = new JSONObject(); |
|
|
|
|
body.put("token", token); |
|
|
|
|
body.put("storeId", storeId); |
|
|
|
|
HttpEntity entity = new StringEntity(body.toString(), StandardCharsets.UTF_8); |
|
|
|
|
String res = HttpKits.post(String.format("%s/api/v1/store/data/delete", ProjectConstants.BASE_URI), headers(), entity); |
|
|
|
|
JSONObject data = new JSONObject(res); |
|
|
|
|
return data.getBoolean("data"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 删除API数据源下的所有分组和表 |
|
|
|
|
* @throws Exception 操作失败则抛出此异常 |
|
|
|
|