import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 机房列表分页查询
 * @param {查询条件} data
 */
export function listOdfRooms(query) {
  return request({
    url: 'business/OdfRooms/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增机房列表
 * @param data
 */
export function addOdfRooms(data) {
  return request({
    url: 'business/OdfRooms',
    method: 'post',
    data: data,
  })
}
/**
 * 新增机房列表
 * @param data
 */
export function addOdfRoomsExpert(data) {
  return request({
    url: 'business/OdfRooms/expert',
    method: 'post',
    data: data,
  })
}
/**
 * 修改机房列表
 * @param data
 */
export function updateOdfRooms(data) {
  return request({
    url: 'business/OdfRooms',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取机房列表详情
 * @param {Id}
 */
export function getOdfRooms(id) {
  return request({
    url: 'business/OdfRooms/' + id,
    method: 'get'
  })
}

/**
 * 删除机房列表
 * @param {主键} pid
 */
export function delOdfRooms(pid) {
  return request({
    url: 'business/OdfRooms/delete/' + pid,
    method: 'POST'
  })
}
// 导出机房列表
export async function exportOdfRooms(query) {
  await downFile('business/OdfRooms/export', { ...query })
}
