import Axios from 'axios'

import {REQUEST_CONFIG, PERFORMANCE_CONFIG_ALL, PERFORMANCE_CONFIG_MODIFY, PERFORMANCE_TYPE_ALL} from "../../utils/RequestUrls";

var staticMethods = {

  // 获取所有性能配置
  getAllPerformanceMonitorCollection: function () {
    return Axios.get(PERFORMANCE_CONFIG_ALL);
  },

  // 获取所有性能事件
  getAllPerformanceTypeCollection: function () {
    return Axios.get(PERFORMANCE_TYPE_ALL);
  },

  // 修改性能门限
  /**
   * @Description  :
   * @author       : ls
   * @date         : 2020/4/26 10:57
   * @param        :
   * @return       :
   */
  putPerformanceMonitor: function (performConfig) {
    return Axios.put(PERFORMANCE_CONFIG_MODIFY,performConfig,REQUEST_CONFIG);
  },
  /**
   * @Description  : chaxun
   * @author       : ls
   * @date         : 2020/4/26 12:54
   * @param        :
   * @return       :
   */
  apiConditionQueryThreshold: function (val) {
    return Axios.put(PERFORMANCE_CONFIG_ALL)
  }
};

function PerformanceMonitorAPI (websocketService = null) {

  return Object.freeze(Object.assign(
    {
      // object methods comes here
    },
    staticMethods
  ))
}
// inject static methods
Object.assign(PerformanceMonitorAPI, staticMethods);
export default PerformanceMonitorAPI
