import request from '@/router/axios';

//获取设备列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/cyzh-third/wvp/device/query/devices',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

//同步更新设备通道信息
export const sync = (deviceId) => {
  return request({
    url: '/api/cyzh-third/wvp/device/devices/' + deviceId + "/sync",
    method: 'post',
  })
}

//获取设备通道列表
export const getChannelList = (current, size, deviceId, params) => {
  return request({
    url: '/api/cyzh-third/wvp/device/query/' + deviceId + '/channels',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

//设备点播
export const startPlay = (deviceId, channelId) => {
  return request({
    url: '/api/cyzh-third/wvp/device/play/start/' + deviceId + "/" + channelId,
    method: 'get',
  })
}

//设备停止播放
export const stopPlay = (deviceId, channelId) => {
  return request({
    url: '/api/cyzh-third/wvp/device/play/stop/' + deviceId + "/" + channelId,
    method: 'get',
  })
}

//获取设备录像
export const getRecord = (deviceId, channelId, params) => {
  return request({
    url: '/api/cyzh-third/wvp/device/query/record/' + deviceId + "/" + channelId,
    method: 'get',
    params: {
      ...params,
    }
  })
}

//查询设备视频流信息
export const getMediaInfo = (params) => {
  return request({
    url: '/api/cyzh-third/wvp/device/query/mediaInfo',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//删除设备
export const deleteDevice = (deviceId) => {
  return request({
    url: '/api/cyzh-third/wvp/device/query/' + deviceId + '/delete',
    method: 'get',
  })
}

//开始播放录像
export const startPlayBack = (deviceId, channelId, params) => {
  return request({
    url: '/api/cyzh-third/wvp/playback/start/' + deviceId + "/" + channelId,
    method: 'get',
    params: {
      ...params,
    }
  })
}

//开始播放录像
export const stopPlayBack = (deviceId, channelId) => {
  return request({
    url: '/api/cyzh-third/wvp/playback/stopPlay/' + deviceId + "/" + channelId,
    method: 'get',
  })
}



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

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

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

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

export const pageByBuilding = (current, size, params) => {
  return request({
    url: '/api/cyzh-smart-device/videoclouddevice/pageByBuilding',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const pushStream = (params) => {
  return request({
    url: '/api/cyzh-smart-device/videoclouddevice/pushStream',
    method: 'get',
    params: {
      ...params,
    }
  })
}*/
