import { request } from '@umijs/max';

export async function devicePage(body) {
    return request('/admin/device/page', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}

export async function deviceAdd(body) {
    return request('/admin/device/batchAdd', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}


export async function deviceUpdate(body) {
    return request('/admin/device/update', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}

export async function deleteBatchByIds(body) {
    return request('/admin/device/deleteBatchByIds', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}

export async function getInfo(params) {
    return request('/admin/device/get', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        params
    });
}



export async function exportExcel(body) {
    return request('/admin/device/exportExcel', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
        responseType: 'blob'
    });
}

export async function deviceImport(body) {
    return request('/admin/device/import', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}

export async function getEnable(params) {
    return request('/admin/device/enable', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        params
    });
}
