Skip to content

分区相关接口 ​

获取分区列表 ​

请求URL ​

  • /api/v1/partition/getPartitionList?type=类型(0:视频;1:文章)

请求方式 ​

  • GET

返回示例 ​

json
{
  "code": 200,
  "data": {
    "partitions": [
      {
        "id": 1,
        "name": "动画",
        "type": 0,
        "parentId": 0,
        "createdAt": "2021-07-16T08:49:54Z",
      },
      {
        "id": 2,
        "name": "MAD·AMV",
        "type": 0,
        "parentId": 1,
        "createdAt": "2021-07-16T08:49:54Z",
      }
    ]
  },
  "msg": "ok"
}

返回参数说明 ​

参数名类型说明
idint分区ID
namestring分区名
typeint类型,0:视频;1:文章
parentIdint所属分区ID
createdAtstring分区创建时间

备注 ​

无

新增分区 ​

请求URL ​

  • /api/v1/partition/addPartition

请求方式 ​

  • POST

请求头 ​

  • Authorization': token
  • "content-type": "application/json",

参数 ​

参数名必选类型说明
name是string分区名
type是int类型,0:视频;1:文章
parentId否int所属分区id

返回示例 ​

json
{
  "code": 200,
  "data": null,
  "msg": "ok"
}

备注 ​

无

删除分区 ​

请求URL ​

  • /api/v1/partition/deletePartition/分区ID

请求方式 ​

  • DELETE

请求头 ​

  • Authorization': token

返回示例 ​

json
{
  "code": 200,
  "data": null,
  "msg": "ok"
}

备注 ​

无

根据 MIT 许可证发布