import request from '@/utils/request'

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

export function del(id) {
  return request({
    url: 'api/sDevice/' + id,
    method: 'delete'
  })
}

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

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

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

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

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

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

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

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

export function getDeviceByProjectid(projectid) {
  return request({
    url: 'api/getDeviceByProjectid/' + projectid,
    method: 'get'
  })
}
