Skip to content

获取用户硬件(设备)信息

请求方式

bash
POST {您的域名}/api/ai-dol/v1/device-list

请求头

text
Authorization: Bearer {您的apiKey}
X-Signature: {计算的签名}

请求参数

参数名类型是否必填示例值说明
accountstring680857435用户 ID/账号/邮箱
requestIdstringreq_abc123客户端生成唯一请求标识
timestampnumber1760581487000毫秒级时间戳

响应格式(JSON)

成功响应

json
{
  "code": 10200,
  "success": true,
  "message": "OK",
  "data": [
    {
      "category_name": "智能设备",
      "device_code": "DEV001234567",
      "device_name": "震动棒",
      "is_selected": true,
      "is_precise_control_supported": true,
      "device_functions": [
        {
          "function_name": "震动",
          "function_type": "vibrate",
          "command": {
            "level_commands": [
              "START",
              "LEVEL_1",
              "LEVEL_2"
            ],
            "stop_command": "STOP"
          }
        },
        {
          "function_name": "伸缩",
          "function_type": "thrust",
          "command": {
            "level_commands": [
              "EXTEND",
              "RETRACT"
            ],
            "stop_command": "STOP"
          }
        }
      ]
    },
    {
      "category_name": "智能设备",
      "device_code": "DEV001234568",
      "device_name": "飞机杯",
      "is_selected": false,
      "is_precise_control_supported": true,
      "device_functions": [
        {
          "function_name": "加热",
          "function_type": "heat",
          "command": {
            "level_commands": [
              "UP"
            ],
            "stop_command": "STOP"
          }
        }
      ]
    }
  ],
  "timestamp": 1760582574528
}

失败

json
{
  "code": 10500,
  "success": false,
  "message": "获取失败",
  "data": null,
  "timestamp": 1760582574528
}

响应参数说明:

参数名类型必 填示例值描述
category_nameString智能设备设备大类名称
device_codeStringDEV001234567设备码/barcode
device_nameString震动棒设备名称
is_selectedStringtrue是否为用户当前选中的设备
is_precise_control_supportedBooleantrue是否支持精准控制
device_functionsArray功能数组,每个为一个功能模块
function_nameString震动功能名称(如震动、伸缩)
function_typeStringvibrate功能类型,可选值:
伸缩: thrust
拍打: tap
吮吸: suck
放电: shock
震动: vibrate
加热: heat
commandObject指令集
level_commandsArray["START","LEVEL_1","LEVEL_2"]正向指令数组(强制要求:需要正序排序,级别越高越靠后)
stop_commandStringSTOP停止指令

Released under the MIT License.