import { request } from '@wisdom-utils/utils';

const REQUEST_METHOD_GET = 'get';
const REQUEST_METHOD_POST = 'post';
// eslint-disable-next-line no-undef
const baseUrl = typeof DUMI_TYPE !== 'undefined' && DUMI_TYPE === 'dumi' ? '/api' : '';

// 获取监控展示配置
export function getMonitorConfig({ params, data } = {}) {
  return request({
    url: `/PandaMonitor/Monitor/MonitorConfig/GetMonitorConf`,
    method: REQUEST_METHOD_GET,
    params,
    data,
  });
}

// 获取传感器类型
export function getSensorType({ params, data } = {}) {
  return request({
    url: `/PandaCore/GCK/Sensor/GetSensorType`,
    method: REQUEST_METHOD_GET,
    params,
    data,
  });
}

// 获取设备实时数据
export function getDeviceRealInfo({ params, data } = {}) {
  return request({
    url: `/PandaMonitor/Monitor/Device/GetDeviceRealInfo`,
    method: REQUEST_METHOD_POST,
    params,
    data,
  });
}

// 获取点表地址
export function getPointAddressEntry({ params, data } = {}) {
  return request({
    url: `/PandaMonitor/Monitor/PointAddress/GetPointAddressEntry`,
    method: REQUEST_METHOD_GET,
    params,
    data,
  });
}

// 获取点表版本
export function getPointAddress({ params, data } = {}) {
  return request({
    url: `/PandaMonitor/Monitor/PointAddress/GetPointAddress`,
    method: REQUEST_METHOD_GET,
    params,
    data,
  });
}
