3 changed files with 74 additions and 3 deletions
@ -1,13 +1,28 @@ |
|||||||
package com.fanruan.hihidata.datasource.server; |
package com.fanruan.hihidata.datasource.server; |
||||||
|
|
||||||
|
import com.fanruan.hihidata.datasource.server.http.HttpKits; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
|
||||||
/** |
/** |
||||||
* @author richie |
* @author richie |
||||||
* Created by richie on 2022/9/16 |
* Created by richie on 2022/9/16 |
||||||
*/ |
*/ |
||||||
public class ServerApplication { |
public class ServerApplication { |
||||||
|
|
||||||
public static void main(String... args) { |
public static void main(String... args) throws Exception { |
||||||
Authentication authentication = new Authentication(args[0], args[1]); |
Authentication authentication = new Authentication(args[0], args[1]); |
||||||
DatasourceOperation operation = new DatasourceOperation(authentication); |
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); |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue