import request from "@/utils/request";

//创建设备信息
const add = (data) => {
    return request({
        url: `/devices`,
        method: "post",
        data: data
    });
}
//获取设备状态列表
const getStatus = () => {
    return request({
        url: '/devices/status/detail',
        method: 'get'
    })
}
//获取设备状态列表
const getSimple = () => {
    return request({
        url: '/devices/status/simple',
        method: 'get'
    })
}
//获取未注册设备列表
const unregisted = (data) => {
    return request({
        url: '/devices/unregisted',
        method: 'get',
        params:data
    })
}
//删除设备
const deleteDevices = (id) => {
    return request({
        url: `/devices/${id}`,
        method: "delete"
    });
}
//获取设备信息
const devicesInfo = (id) => {
    return request({
        url: `/devices/${id}`,
        method: "get"
    });
}
//更新设备信息
const updateDevices = (id,data) => {
    return request({
        url: `/devices/${id}`,
        method: "put",
        data: data
    });
}

export default {
    add,
    getStatus,
    getSimple,
    unregisted,
    deleteDevices,
    devicesInfo,
    updateDevices,
}
