import request from '@/router/axios';

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

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

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

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

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


export const getLiftResidentialSelect = () => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/getLiftResidentialSelect',
    method: 'get',
  })
}

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

export const getRealvideo = (registerCode) => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/getRealvideo',
    method: 'get',
    params: {
      registerCode
    }
  })
}



export const getLiftHisAlarm = (registerCodes) => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/getLiftHisAlarm',
    method: 'get',
    params: {
      registerCodes
    }
  })
}

export const sync = () => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/sync',
    method: 'post',
  })
}

export const getLiftStatus = (registerCode) => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/getLiftStatus',
    method: 'get',
    params: {
      registerCode
    }
  })
}

export const getLiftPointData = (registerCode) => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/getLiftPointData',
    method: 'get',
    params: {
      registerCode
    }
  })
}

export const getAlarmVideo = (alarmCode) => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/getAlarmVideo',
    method: 'get',
    params: {
      alarmCode
    }
  })
}

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

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

export const subscribeAlarmData = (webHookUrl) => {
  return request({
    url: '/api/cyzh-smart-device/elevatordevice/subscribeAlarmData',
    method: 'post',
    params: {
      webHookUrl
    }
  })
}
