import request from '@/utils/request'

// 根据用户id 查询设备
export function queryRoomDeviceByUser(params) {
  return request({
    url: 'api/dmRoomDevice/queryRoomDeviceByUser',
    method: 'get',
    params
  })
}

// 查询所有默认分页
export function queryRoomAllDevice(params) {
  return request({
    url: 'api/dmRoomDevice/list',
    method: 'get',
    params
  })
}

// 添加设备
export function add(data) {
  return request({
    url: 'api/dmRoomDevice',
    method: 'post',
    data
  })
}

// 修改设备
export function del(ids) {
  return request({
    url: 'api/dmRoomDevice/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/dmRoomDevice',
    method: 'put',
    data
  })
}

export function download() {
  return request({
    url: 'api/dmRoomDevice/download',
    method: 'get'
  })
}

export function doImport(data) {
  return request({
    url: '/api/dmRoomDevice/importData',
    method: 'post',
    data
  })
}
export default { add, edit, del, download, doImport, queryRoomDeviceByUser, queryRoomAllDevice }
