import request from '@/router/axios';

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

export const pageByBuilding = (current, size, params) => {
  return request({
    url: '/api/yc_video_cloud_device/videoclouddevice/pageByBuilding',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getListByResidential = (residentialName) => {
  return request({
    url: '/api/yc_video_cloud_device/videoclouddevice/getByResidential',
    method: 'get',
    params: {
      residentialName,
    }
  })
}

export const getByResidentialAndDeviceName = (residentialId,buildingId,deviceName) => {
  return request({
    url: '/api/yc_video_cloud_device/videoclouddevice/getByResidentialAndDeviceName',
    method: 'get',
    params: {
      residentialId,
      buildingId,
      deviceName
    }
  })
}
export const bindResidentialBatch = (deviceIds,residentialId,buildingId) => {
  return request({
    url: '/api/yc_video_cloud_device/videoclouddevice/bindResidentialBatch',
    method: 'post',
    params: {
      deviceIds,
      residentialId,
      buildingId
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/yc_video_cloud_device/videoclouddevice/detail',
    method: 'get',
    params: {
      id
    }
  })
}

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

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

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


export const updateVideoDevice = (row) => {
  return request({
    url: '/api/yc_video_cloud_device/videoclouddevice/update',
    method: 'post',
    data: row
  })
}
