import request from '@/utils/request'

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

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

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

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

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