残像API
高效、稳定的残像效果相关接口服务
GET 获取残像效果列表
/api/v1/afterimage/list
接口描述

获取所有可用的残像效果类型列表,支持分页和筛选。

请求参数
参数名 类型 是否必填 默认值 描述
page int 1 页码
size int 10 每页条数
type string all 残像类型(motion/light/color)
请求示例
GET /api/v1/afterimage/list?page=1&size=10&type=motion HTTP/1.1 Host: api.cankanxiang.com Content-Type: application/json Authorization: Bearer your_token_here
响应示例
{
  "code": 200,
  "msg": "success",
  "data": {
    "list": [
      {
        "id": 1,
        "name": "动态模糊残像",
        "type": "motion",
        "desc": "基于运动轨迹的模糊残像效果",
        "create_time": "2026-03-23 10:00:00"
      },
      {
        "id": 2,
        "name": "光影拖尾残像",
        "type": "light",
        "desc": "带有光影效果的拖尾残像",
        "create_time": "2026-03-23 10:15:00"
      }
    ],
    "pagination": {
      "total": 25,
      "page": 1,
      "size": 10,
      "pages": 3
    }
  }
}
POST 生成残像效果
/api/v1/afterimage/generate
接口描述

根据指定参数生成残像效果图片/视频。

请求体参数
参数名 类型 是否必填 描述
effect_id int 残像效果ID
source_url string 源文件URL(图片/视频)
params object 效果参数(如强度、速度、颜色等)
format string 输出格式(jpg/png/mp4),默认jpg
请求示例
POST /api/v1/afterimage/generate HTTP/1.1 Host: api.cankanxiang.com Content-Type: application/json Authorization: Bearer your_token_here { "effect_id": 1, "source_url": "https://example.com/source.jpg", "params": { "intensity": 0.8, "speed": 1.2, "color": "#ff0000" }, "format": "png" }
响应示例
{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "task_123456789",
    "result_url": "https://example.com/afterimage_result.png",
    "create_time": "2026-03-23 10:30:00",
    "expire_time": "2026-03-30 10:30:00"
  }
}