import request from '@/utils/request'

// 查询MmMachine列表
export function listMmMachine(query) {
    return request({
        url: '/api/v1/mm-machine',
        method: 'get',
        params: query
    })
}

// 查询MmMachine详细
export function getMmMachine (id) {
    return request({
        url: '/api/v1/mm-machine/' + id,
        method: 'get'
    })
}

// 查询MmMachine列表
export function getMmMachineList () {
    return request({
        url: '/api/v1/mm-machine/list',
        method: 'get'
    })
}


// 新增MmMachine
export function addMmMachine(data) {
    return request({
        url: '/api/v1/mm-machine',
        method: 'post',
        data: data
    })
}

// 修改MmMachine
export function updateMmMachine(data) {
    return request({
        url: '/api/v1/mm-machine/'+data.id,
        method: 'put',
        data: data
    })
}

// 批量修改MmMachine
export function updateMmMachineBatch(data) {
    return request({
        url: '/api/v1/mm-machine/batch',
        method: 'put',
        data: data})
}

// 批量修改MmMachine限制
export function updateLimitBatch(data){
    return request({
        url: '/api/v1/mm-machine/limitBatch',
        method: 'put',
        data: data
    })
}

//批量修改MmMachine分组
export function updateMmMachineGroupBatch(data) {
    return request({
        url: '/api/v1/mm-machine/groupBatch',
        method: 'put',
        data: data
    })
}

export function updateMmMachineDescriptionBatch(data) {
    return request({
        url: '/api/v1/mm-machine/descriptionBatch',
        method: 'put',
        data: data
    })
}

// 删除MmMachine
export function delMmMachine(data) {
    return request({
        url: '/api/v1/mm-machine',
        method: 'delete',
        data: data
    })
}

//清除所有绑定
export function uninstallMmMachine(){
    return request({
        url: '/api/v1/mm-machine/uninstall',
        method: 'delete'
    })
}

//清除所有MmMachine
export function clrearAllMmMachine(){
    return request({
        url: '/api/v1/mm-machine/clearAll',
        method: 'delete'
    })
}

//检查是否有设备号遗漏
export function queryIntervalAccount(){
    return request({
        url: '/api/v1/mm-machine/intervalAccount',
        method: 'get',
        responseType: 'blob',
    })
}

//重启设备
export function rebootMachine(data){
    return request({
        url: '/api/v1/mm-machine/reboot',
        method: 'post',
        data: data
    })
}