import request from '@/utils/axios.ts';

// IoT设备查询接口 - 通过后端代理调用
export function iotDeviceQueryList(data) {
    return request({
        url: '/iotDevice/queryList',
        method: 'POST',
        data,
    });
}

// IoT设备定位接口 - 从新的iot_device_data表查询
export function iotDeviceLocation(data) {
    return request({
        url: '/iotDevice/getLocation',
        method: 'POST',
        data,
    });
}

// IoT设备分配接口 - 查询可分配的设备列表
export function iotDeviceAssignableList(data) {
    return request({
        url: '/iotDevice/getAssignableDevices',
        method: 'POST',
        data,
    });
}

// IoT设备分配接口 - 分配设备到装车订单
export function iotDeviceAssign(data) {
    return request({
        url: '/iotDevice/assignDevices',
        method: 'POST',
        data,
    });
}

// IoT设备分配接口 - 分配设备到租户
export function iotDeviceAssignToTenant(data) {
    return request({
        url: '/iotDevice/assignDevicesToTenant',
        method: 'POST',
        data,
    });
}

// IoT设备解绑接口 - 解绑设备（将tenant_id设置为空）
export function iotDeviceUnassignFromTenant(data) {
    return request({
        url: '/iotDevice/unassignDevicesFromTenant',
        method: 'POST',
        data,
    });
}

// 智能耳标
export function jbqClientList(data) {
    return request({
        url: '/jbqClient/list',
        method: 'POST',
        data,
    });
}
// 智能主机
export function jbqServerList(data) {
    return request({
        url: '/jbqServer/serverList',
        method: 'POST',
        data,
    });
}
// 预警记录列表
export function warningLogList(data) {
    return request({
        url: '/warningLog/pageQuery',
        method: 'POST',
        data,
    });
}

// 预警详情
export function warningDetail(id) {
    return request({
        url: '/warningLog/warningDetail',
        method: 'POST',
        params: { id },
    });
}

// 智能项圈 -列表
export function collarList(data) {
    return request({
        url: '/xqClient/list',
        method: 'POST',
        data,
    });
}
// 智能项圈 -轨迹

export function collarTrack(data) {
    return request({
        url: '/xqClient/xqTrack',
        method: 'POST',
        data,
    });
}

// 智能项圈 -轨迹

export function collarLocation(data) {
    return request({
        url: '/xqClient/xqLocation',
        method: 'POST',
        data,
    });
}

// 运动详情智能项圈 -轨迹
export function collarTrackOrder(data) {
    return request({
        url: '/xqClient/xqDeviceTrack',
        method: 'POST',
        data,
    });
}
