Skip to main content

任务管理

任务管理接口用于创建和管理后台任务。所有接口都需要开发者权限。

获取任务列表

/dev/task/list
获取任务列表。

请求参数

参数名类型必选说明
pageinteger页码,默认1
sizeinteger每页数量
GET /dev/task/list?page=1&size=10
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

获取任务详情

/dev/task/:id
获取指定任务的详细信息。

请求参数

参数名类型必选说明
idstring任务ID
GET /dev/task/task_123
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

创建任务

/dev/task
创建新的任务。

请求参数

参数名类型必选说明
namestring任务名称
descriptionstring任务描述
configobject任务配置
POST /dev/task
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "新任务",
  "description": "这是一个新任务",
  "config": {
    "type": "data_processing",
    "priority": "high"
  }
}

更新任务

/dev/task/:id
更新指定任务的信息。

请求参数

参数名类型必选说明
idstring任务ID
namestring任务名称
descriptionstring任务描述
configobject任务配置
PUT /dev/task/task_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "更新后的任务",
  "description": "这是更新后的任务描述"
}

删除任务

/dev/task/:id
删除指定的任务。

请求参数

参数名类型必选说明
idstring任务ID
DELETE /dev/task/task_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

错误码说明

错误码说明

错误码说明
400请求参数错误
401未授权或令牌无效
403权限不足(需要开发者权限)
404任务不存在
422请求参数验证失败
500服务器错误