import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const getDetailByDeviceId = (imei) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/detail',
    method: 'get',
    params: {
      imei
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/submit',
    method: 'post',
    data: row
  })
}


export const deviceListCount = (params) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/deviceListCount',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getIotDeviceStaticVo = (params) => {
  return request({
    url: '/api/cyzh-smart-device/iotdevice/getIotDeviceStaticVo',
    method: 'get',
    params: {
      ...params,
    }
  })
}

// export const getEnterpriseList = (current, size, params) => {
//   return request({
//     url: '/api/cyzh-enterprise/enterprise/list',
//     method: 'get',
//     params: {
//       ...params,
//       current,
//       size,
//     }
//   })
// }

export const getEnterpriseList = (size) => {
  return request({
    url: '/api/cyzh-enterprise/enterprise/list',
    method: 'get',
    params: {
      size,
    }
  })
}
