import { request } from 'umi';

function menutreepage(params) {
  return request('/kitchen/api​/menu/getmenutreepage', {
    method: 'post',
    data: params,
  });
}

function enable(params) {
  return request(`/kitchen/api​/menu/enable?Id=${params}`);
}

function disable(params) {
  return request(`/kitchen/api/menu/disable?Id=${params}`);
}

function remove(params) {
  return request(`/kitchen/api​/menu/delete`, {
    method: 'post',
    data: params,
  });
}

function add(params) {
  return request(`/kitchen/api​/menu/add`, {
    method: 'post',
    data: params,
  });
}
function update(params) {
  return request(`/kitchen/api​/menu/update`, {
    method: 'post',
    data: params,
  });
}

function trees() {
  return request(`​/kitchen/api/select/menutree/?GetType=ALL`);
}

function  getDicData(code) {
  return request(`/kitchen/api/select/getdictvalue/?TypeCode=${code}`);
}

export default { menutreepage, trees, enable, disable, add, remove, update,getDicData };
