import request from '@/utils/request'

// 获取库位树形结构
export function getWarehouseTree() {
  return request({
    url: '/v1/warehouse/tree',
    method: 'get'
  })
}

// 创建库位
export function createWarehouse(data: any) {
  return request({
    url: '/v1/warehouse',
    method: 'post',
    data
  })
}

// 更新库位
export function updateWarehouse(data: any) {
  return request({
    url: `/v1/warehouse/${data.id}`,
    method: 'put',
    data
  })
}

// 删除库位
export function deleteWarehouse(id: number) {
  return request({
    url: `/v1/warehouse/${id}`,
    method: 'delete'
  })
}
