import { request } from 'umi';
import { getDataBaseUrl,getStoremanagement } from '@/global_data';


export async function GetStoreInfos() {
  return request(getStoremanagement()+'/api/shop/alllist', {
    method: 'GET'
  });
}


//添加设备
export async function AddPrinter(data) {
  return request(getStoremanagement()+`/api/Printer/AddPrinter`, {
    method: 'Post',
    data: data,
  });
}


//获取
export  function GetPrinter(data) {
  return request(getStoremanagement()+`/api/Printer/GetPrinterList?storeId=`+data, {
    method: 'get',
    data: data,
  });
}


//修改设备
export async function UpdatePrinter(data) {
  return request(getStoremanagement()+`/api/Printer/UpdatePrinter`, {
    method: 'post',
    data: data,
  });
}

//设置主机
export async function SetPrinterHost(storeid,id ) {
  return request(getStoremanagement()+`/api/Printer/SetPrinterHost?storeId=${storeid}&id=${id}`, {
    method: 'post',
  });
}

//删除
export async function DelPrinter(data) {
  return request(getStoremanagement()+`/api/Printer/DelPrinter`, {
    method: 'post',
    data: data,
  });
}

  //获取模板
  export async function GetPrinterTemplater(data) {
    return request(getStoremanagement()+`/api/Printer/GetPrinterTemplater`, {
      method: 'get',
      data: data,
    });
  }
  
  //获取店铺菜单
  export async function GetStoreFoodMenu(data) {
    return request(getStoremanagement()+`/api/Printer/GetStoreFoodMenu?storeId=`+data, {
      method: 'get',
      data: data,
    });
  }
