import createAxios from '@/utils/request'

import {ADVANCE_BOOT} from '@/utils/constantRequest'


/**
 * 新增终端
 */
export const addSgSensitiveUnit = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgSensitiveUnit/add',
        method: 'POST',
        data: data
    })
}

/**
 * 根据终端id查询所有元器件
 */
export const queryUnitByMachineId = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgSensitiveUnit/queryUnitByMachineId?machineId='+data,
        method: 'GET',
    })
}


/**
 * 更新终端
 */
export const updateSgSensitiveUnit = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgSensitiveUnit/update',
        method: 'POST',
        data: data
    })
}


/**
 * 删除终端
 */
export const deleteSgSensitiveUnit = (data: any) => {
    let ids = [data]
    return createAxios({
        url: ADVANCE_BOOT + '/sgSensitiveUnit/delete',
        method: 'POST',
        data: ids
    })
}
