import request from '@/utils/request'

// 创建仓库
export function createWarehouse(data) {
  return request({
    url: '/ecw/warehouse/create',
    method: 'post',
    data: data
  })
}

// 更新仓库
export function updateWarehouse(data) {
  return request({
    url: '/ecw/warehouse/update',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function deleteWarehouse(id) {
  return request({
    url: '/ecw/warehouse/delete?id=' + id,
    method: 'delete'
  })
}

// 获得仓库
export function getWarehouse(id) {
  return request({
    url: '/ecw/warehouse/get?id=' + id,
    method: 'get'
  })
}

// 获得仓库分页
export function getWarehousePage(query) {
  return request({
    url: '/ecw/warehouse/page',
    method: 'get',
    params: query
  })
}

// 导出仓库 Excel
export function exportWarehouseExcel(query) {
  return request({
    url: '/ecw/warehouse/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
