import request from '@/utils/request'

// 查询菜单列表
export function listMenu(query) {
  let temp =Object.assign({},query);
  temp.consumerType = temp.consumerType.join(',');
    return request({
    url: '/canteen/menu/list',
    method: 'get',
    params: temp
  })
}

// 查询菜单详细
export function getMenu(menuId) {
  return request({
    url: '/canteen/menu/' + menuId,
    method: 'get'
  })
}

// 新增菜单
export function addMenu(data) {
  return request({
    url: '/canteen/menu',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function updateMenu(data) {
  return request({
    url: '/canteen/menu',
    method: 'put',
    data: data
  })
}

// 删除菜单
export function delMenu(menuId) {
  return request({
    url: '/canteen/menu/' + menuId,
    method: 'delete'
  })
}

// 导出菜单
export function exportMenu(query) {
  return request({
    url: '/canteen/menu/export',
    method: 'get',
    params: query
  })
}
