# 普通数据

# 导入 CSV 文件

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/importCsv

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 可选值 类型 是否必须 默认值 说明
title - String - 数据标题
fileId - String - 导入的文件 ID
encoding - String - 手动指定编码,如不指定则自动检测编码
fields - Array [Object] - 字段名和字段类型列表
├ name - String - 字段名
└ type - String - 字段类型
header - Array - 字段列表(不指定则使用 CSV 文件的第一行)
dataFrom - Number 1 从第几行开始为数据

# 请求示例:

POST http://host:port/heycloud/api/io/cdataset/importCsv

{
  title: "北京街区 2020",
  fileId: "xxxxxxx",
  fields: [{"name": "id", "type": "int"}],
}

# 正确响应示例:

{
  "result": {
     "cdatasetId": "<uuid>",
     "notifyAt":  "2021-03-01T10:23:44.769Z"
   }
}

# 错误响应示例:

{
  "error": "ERROR",
  "message": "错误信息",
}

# 导入 Excel 中的某一张表

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/importExcelSheet

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 可选值 类型 是否必须 默认值 说明
title - String - 数据标题
fileId - String - 导入的文件 ID
fields - Array [Object] - 字段名和字段类型列表
├ name - String - 字段名
└ type - String - 字段类型
sheetName - String - 要导入的表名
header - Array - 字段列表(不指定则使用表的第一行作为 header)
dataFrom - Number 1 从第几行开始为数据

# 请求示例:

POST http://host:port/heycloud/api/io/cdataset/importExcelSheet

{
   title: "北京街区 2020",
   fileId: "xxxxxxx",
   sheetName: "工作表1",
   fields: [{"name": "id", "type": "int"}]
}

# 正确响应示例:

{
  "result": {
     "id": "<uuid>"
	 }
}

# 错误响应示例:

{
  "error": "ERROR",
  "message": "错误信息",
}

# 获取导入中的普通数据集信息

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/importing

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符,为 * 则表示不过滤帐号

# 请求参数:

参数名称 类型 是否必须 默认值 说明
sortField String startAt 用于排序的字段
sortType String asc 排序的类型
limit Number 10 最多返回的数据项,用于显示部分还没结束的导入进程

# 请求示例:

GET http://host:port/heycloud/api/io/cdataset/importing?sortField=startAt&sortType=asc&limit=10

# 正确响应示例:

{
  "result": {...}
}

# 错误响应示例:

{
  "error": "ERROR",
  "message": "错误信息",
}

# 取消导入操作

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/importing/:cdatasetId/cancel

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
cdatasetId String - 数据集 ID

# 请求示例:

POST http://host:port/heycloud/api/io/cdataset/importing/xxxxx/cancel

# 正确响应示例:

{
 	"result": {...}
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 根据普通数据集的 ID 获取信息

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/:cdatasetId

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
cdatasetId String - 数据集 ID

# 请求示例:

GET http://host:port/heycloud/api/io/cdataset/xxxxx

# 正确响应示例:

{
  "result": {...}
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 将无主数据分配给某个帐号

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/:cdatasetId/assign

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限

# 请求参数:

参数名称 类型 是否必须 默认值 说明
cdatasetId String - 数据集 ID
accountId String - 账号

# 请求示例:

POST http://host:port/heycloud/api/io/cdataset/xxxxx/assign

{
   accountId: "xxx"
}

# 正确响应示例:

{
  "result": {...}
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 复制一个普通数据集

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/:cdatasetId/duplicate

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
cdatasetId String - 数据集 ID

# 请求示例:

POST http://host:port/heycloud/api/io/cdataset/xxxxx/duplicate

# 正确响应示例:

{
   "result": {...}
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 导出一个普通数据集

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/:cdatasetId/export

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
cdatasetId String - 数据集 ID
format String GeoJSON 文件导出格式
ignoreExist Boolean - 忽略已存在的导出文件,强制重新导出

# 请求示例:

POST http://host:port/heycloud/api/io/cdataset/xxxxx/export

{
   format: "xxx",
   ignoreExist: true,
}

# 正确响应示例:

{
  "result": {"fileId": "xxx", "suffix": "geojson"}
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 取消导出操作

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/exporting/:fileId/cancel

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
fileId String - 导出的文件 ID

# 请求示例:

POST http://host:port/heycloud/api/io/cdataset/exporting/xxxxx/cancel

# 正确响应示例:

{
  "result": {...}
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 返回导出文件的信息

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/export/:fileId

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
fileId String - 导出的文件 ID

# 请求示例:

GET http://host:port/heycloud/api/io/cdataset/export/xxxxx

# 正确响应示例:

{
  "result": {"fileId": "xxx", "suffix": "csv"}
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 下载导出的文件

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/export/:fileId/download

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
fileId String - 导出的文件 ID

# 请求示例:

GET http://host:port/heycloud/api/io/cdataset/export/xxxxx/download

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 删除一个普通数据集

# 请求 URL:

  • http://host:port/heycloud/api/io/cdataset/:cdatasetId

# 请求方式:

  • DELETE

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
cdatasetId String - 数据集 ID

# 请求示例:

DELETE http://host:port/heycloud/api/io/cdataset/xxxxx

# 正确响应示例:

{
  "result": {
  "id": "xxx",
  "deletedAt": "..."
   }
}

# 错误响应示例:

{
  "error": "ERROR",
  "message": "错误信息",
}