import request from '@/utils/request'
// 站点列表
export function getSiteInfoList({siteName,startTime, endTime,pageSize,pageNum}) {
  return request({
    url: `/ems/siteConfig/getSiteInfoList?siteName=${siteName}&startTime=${startTime}&endTime=${endTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
    method: 'get'
  })
}

// 设备列表
export function getDeviceInfoList({siteId,pageSize,pageNum}) {
  return request({
    url: `/ems/siteConfig/getDeviceInfoList?siteId=${siteId}&pageSize=${pageSize}&pageNum=${pageNum}`,
    method: 'get'
  })
}

// 设备详情
export function getDeviceDetailInfo(id) {
  return request({
    url: `/ems/siteConfig/getDeviceDetailInfo?id=${id}`,
    method: 'get'
  })
}

// 获取所有设备类别
export function getDeviceCategory() {
  return request({
    url: `/ems/siteConfig/getDeviceCategory`,
    method: 'get'
  })
}

// 新增设备
export function addDevice(data) {
  return request({
    url: `/ems/siteConfig/addDevice`,
    method: 'post',
    data
  })
}
// 编辑设备
export function updateDevice(data) {
  return request({
    url: `/ems/siteConfig/updateDevice`,
    method: 'post',
    data
  })
}
// 删除设备
export function deleteService(id) {
  return request({
    url: `/ems/siteConfig/deleteService/`+id,
    method: 'delete',
  })
}

//获取所有设备
export function getDeviceList(siteId) {
  return request({
    url: `/ems/siteConfig/getDeviceList?siteId=${siteId}`,
    method: 'get',
  })
}
