import request from '@/utils/request'

// 查询设施列表
export function listFacilities(query) {
    return request({
        url: '/system/facilities/list',
        method: 'get',
        params: query
    })
}

export function listFacilities1(query) {
    return request({
        url: '/system/facilities/list',
        method: 'post',
        data: query
    })
}

// 查询设施详细
export function getFacilities(id) {
    return request({
        url: '/system/facilities/' + id,
        method: 'get'
    })
}

// 新增设施
export function addFacilities(data) {
    return request({
        url: '/system/facilities',
        method: 'post',
        data: data
    })
}

// 修改设施
export function updateFacilities(data) {
    return request({
        url: '/system/facilities',
        method: 'put',
        data: data
    })
}

// 删除设施
export function delFacilities(id) {
    return request({
        url: '/system/facilities/' + id,
        method: 'delete'
    })
}


export function uploadFacilities(files) {

  const form = new FormData();
  form.append('file', files);
  return request({
    url: "/system/facilities/upload",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data: form,
  });
}
