import request from '@/utils/request'

/**
 
 * @returns
 */
export function tbPrintMachine(data, method = 'post') {
    return request({
        url: '/api/tbPrintMachine',
        method: method,
        data: {
            shopId: localStorage.getItem('shopId'),
            ...data
        }
    })
}
// 打印机切换
export function switchtbPrintMachine(data, method = 'post') {
    return request({
        url: '/api/shop-config/printer/update-status',
        method: method,
        data: {
            shopId: localStorage.getItem('shopId'),
            ...data
        }
    })
}
// 打印机部分
export function tbShopCategory(params) {
    return request({
        url: '/api/tbShopCategory',
        method: 'get',
        params
    })
}
/**
 * 打印机列表
 * @returns
 */
export function tbPrintMachineGet(params) {
    return request({
        url: '/api/shop-config/printer/list',
        method: 'get',
        params: {
            ...params
        }
    })
}
// 删除
export function delTableHandle(id) {
    return request({
        url: '/api/shop-config/printer/' + id,
        method: 'DELETE',
    })
}
//  * 打印机详情
export function printerd(id) {
    return request({
        url: '/api/shop-config/printer/' + id,
        method: 'get',

    })
}
// 编辑 新增打印机
export function configprinter(data, method = "post") {
    return request({
        url: `/api/shop-config/printer`,
        method: method,
        data
    });
}
