import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/smartapplication/smartdevice/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getEnterpriseList = (params) => {
  return request({
    url: '/api/smartapplication/smartdevice/getEnterpriseList',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getSmartDeviceStaticVo = (params) => {
  return request({
    url: '/api/smartapplication/smartdevice/getSmartDeviceStaticVo',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const deviceListCount = (params) => {
  return request({
    url: '/api/smartapplication/smartdevice/deviceListCount',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getGateStatic = () => {
  return request({
    url: '/api/smartapplication/smartdevice/getGateStatic',
    method: 'get',

  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/smartapplication/smartdevice/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const getDetailByDeviceId = (imei) => {
  return request({
    url: '/api/smartapplication/smartdevice/detail',
    method: 'get',
    params: {
      imei
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/smartapplication/smartdevice/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/smartapplication/smartdevice/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/smartapplication/smartdevice/submit',
    method: 'post',
    data: row
  })
}

export const batchBindResidential = (row) => {
  return request({
    url: '/api/smartapplication/smartdevice/batchBindResidential',
    method: 'post',
    data: row
  })
}

export const getDeviceList = (current, size, params) => {
  return request({
    url: '/grid/iot/device/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
