From 4275b01cfe34af73b117156b081ca7be81b05543 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 16 Sep 2022 19:56:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BE=9B=E5=AE=8C=E6=95=B4=E7=9A=84?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 960e988..8a93ba9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # jsy-api-datasource-demo -API数据源示例 \ No newline at end of file +API数据源示例 + +```java +Authentication authentication = new Authentication("#key", "#secret"); +DatasourceOperation operation = new DatasourceOperation(authentication); +operation.open(); +// 创建一个分组,如果已经存在,则直接跳过 +operation.createGroup("TestGroup"); +// 在分组下创建一个表,返回创建的表的ID,如果表已经存在,则直接返回表ID +String tableId = operation.createTable("HelloTable", "TestGroup"); +// 获取上传文件的url +String fileUploadUrl = operation.requestUploadUrl(tableId); +// 将数据文件上传 +HttpKits.upload(fileUploadUrl, new File(System.getProperty("user.dir") + "/data/地区数据分析.csv")); +// 标记该表的数据已经上传完成 +operation.markAsFinish(tableId); + +``` \ No newline at end of file