import request from '@/utils/request'

// 创建商品
export function createGoods(data) {
  return request({
    url: '/restaurant/restaurant/create',
    method: 'post',
    data: data
  })
}

// 更新商品
export function updateGoods(data) {
  return request({
    url: '/restaurant/restaurant/update',
    method: 'put',
    data: data
  })
}

// 删除商品
export function deleteGoods(id) {
  return request({
    url: '/restaurant/restaurant/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商品
export function getGoods(id) {
  return request({
    url: '/restaurant/restaurant/get?id=' + id,
    method: 'get'
  })
}

// 获得商品分页
export function getGoodsPage(params) {
  return request({
    url: '/restaurant/restaurant/page',
    method: 'get',
    params
  })
}
// 导出商品 Excel
export function exportGoodsExcel(params) {
  return request({
    url: '/restaurant/restaurant/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
