import createAxios from '@/utils/request'

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

/**
 * 新增终端
 */
export const listMachine = (productLineId: any) => {
    const data = {productLineId}
    return createAxios({
        url: ADVANCE_BOOT + '/sgMachine/list',
        method: 'POST',
        data: data
    })
}


/**
 * 根据生产线id查询所有终端
 */
export const querySgMachineByProductLineId = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgMachine/querySgMachineByProductLineId?productId='+data,
        method: 'GET',
    })
}



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


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


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