import request from '@/utils/request'

// 创建货架
export function createShelf(data) {
  return request({
    url: '/ecw/shelf/create',
    method: 'post',
    data: data
  })
}

// 更新货架
export function updateShelf(data) {
  return request({
    url: '/ecw/shelf/update',
    method: 'put',
    data: data
  })
}

// 删除货架
export function deleteShelf(id) {
  return request({
    url: '/ecw/shelf/delete?id=' + id,
    method: 'delete'
  })
}

// 获得货架
export function getShelf(id) {
  return request({
    url: '/ecw/shelf/get?id=' + id,
    method: 'get'
  })
}

// 获得货架分页
export function getShelfPage(query) {
  return request({
    url: '/ecw/shelf/page',
    method: 'get',
    params: query
  })
}

// 导出货架 Excel
export function exportShelfExcel(query) {
  return request({
    url: '/ecw/shelf/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}