import request from '@/utils/request'

export function getDevices(params) {
  return request({
    url: 'api/dmDevice',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'api/dmDevice',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/dmDevice/',
    method: 'delete',
    data: ids
  })
}

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

export function getDeviceListByRoomId(roomId) {
  return request({
    url: 'api/dmDevice/getDeviceListByRoomId?roomId=' + roomId,
    method: 'get'/* ,
    data */
  })
}


export default { add, edit, del, getDevices,getDeviceListByRoomId }
