/**
 * 设备管理接口
 */
import request from '@/utils/request'
import qs from 'qs'

// 设备型号名称
export function getDevice(params) {
  return request({
    url: 'device/type',
    method: 'get',
    params
  })
}

// 设备查询
export function getDeviceModelList(params) {
  return request({
    url: 'deviceModels/list',
    method: 'get',
    params
  })
}

// 添加设备
export function addDeviceModel(params) {
  return request({
    url: 'deviceModels/add',
    method: 'post',
    params
  })
}
// 修改设备
export function updateDeviceModel(params) {
  return request({
    url: 'deviceModels/update',
    method: 'post',
    params
  })
}
// 删除设备
export function delDeviceModel(ids) {
  return request({
    url: 'deviceModels/delete',
    method: 'post',
    params: {
      ids: ids
    },
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  })
}
