import request from '@/utils/request'

// 创建柜型配置
export function createCabinet(data) {
  return request({
    url: '/ecw/cabinet/create',
    method: 'post',
    data: data
  })
}

// 更新柜型配置
export function updateCabinet(data) {
  return request({
    url: '/ecw/cabinet/update',
    method: 'put',
    data: data
  })
}

// 删除柜型配置
export function deleteCabinet(id) {
  return request({
    url: '/ecw/cabinet/delete?id=' + id,
    method: 'delete'
  })
}

// 获得柜型配置
export function getCabinet(id) {
  return request({
    url: '/ecw/cabinet/get?id=' + id,
    method: 'get'
  })
}

// 获得柜型配置分页
export function getCabinetPage(query) {
  return request({
    url: '/ecw/cabinet/page',
    method: 'get',
    params: query
  })
}

// 导出柜型配置 Excel
export function exportCabinetExcel(query) {
  return request({
    url: '/ecw/cabinet/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
