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

export default {

  //获取所有门店
  GetAllStore() {
    return request(getStoremanagement()+'/api/shop/alllist', {
      method: 'GET',
    });
  },


  //根据门店ID查询 档口分页列表
  GetGateListByStorePage(StoreId, Current, PageSize, TenantId = '') {
    return request(getStoremanagement()+`/api/GateInfo/gatelist?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, {
      method: 'GET',
      headers: {
        TenantId: TenantId
      }
    });
  },

  /** 档口管理：Start */
  // 新增档口
  AddGate(data) {
    return request(getStoremanagement()+`/api/GateInfo/add`, {
      method: 'POST',
      data
    });
  },

  //更新档口信息
  UpdateGateInfo(data, TenantId = '') {
    return request(getStoremanagement()+`/api/GateInfo/Update`, {
      method: 'POST',
      data,
      headers: {
        TenantId: TenantId
      }
    });
  },

  //获取字典数据数据（设备屏幕显示）
  GetDicList(TypeCode) {
    return request(getDataBaseUrl()+`/api/dictdata/getdiclist?typeCode=`+TypeCode, {
      method: 'Get',
    });
  },

  //添加屏幕显示
  AddGateSetUp(data) {
    return request(getStoremanagement()+`/api/GateInfo/AddGateSetUp`, {
      method: 'POST',
      data
    });
  },

  //添加屏幕显示
  GetGateSetUp(data) {
    return request(getStoremanagement()+`/api/GateInfo/GetGateSetUp`, {
      method: 'POST',
      data
    });
  },

  //删除档口
  Del(data) {
    return request(getStoremanagement()+`/api/GateInfo/del?id=` + data, {
      method: 'POST',
    });
  },

  GetGoodsByMenuIdPage(params) {
    return request(getDataBaseUrl()+'/api/FoodMenu/GetGoodsByMenuIdPage', {
      method: 'get',
      data: {
        ...params,
      },
    });
  },

  GetGoodsList() {
    return request(getDataBaseUrl()+'/api/goods/getgoodslist', {
      method: 'get',
    });
  },

  //设置屏幕显示菜品
  AddGateFood(data) {
    return request(getStoremanagement()+`/api/GateInfo/AddGateFood`, {
      method: 'POST',
      data
    });
  },

   //获取设置屏幕显示菜品
   GetGateFoodList(data) {
    return request(getStoremanagement()+`/api/GateInfo/GetGateFoodList?gateId=`+data, {
      method: 'get',
      data
    });
  },

}
