import {ALARM_FILTER_ADMQ, ALARM_FILTER_TOTAL, ALARM_FILTER_QUERY, REQUEST_CONFIG} from '../../utils/RequestUrls'
import Axios from 'axios'
let staticMethods = {
  /**
   * @Description  : 分页查询
   * @author       : ls
   * @date         : 2020/7/23 9:55
   * @param        :
   * @return       :
   */
  putAlarmFilterQueryterms: function (beginItem, endItem, selectList) {
    return Axios.put(ALARM_FILTER_QUERY + '/' + beginItem + '/' + endItem + '/', selectList, REQUEST_CONFIG)
  },
  /**
   * @Description  : 查询总数
   * @author       : ls
   * @date         : 2020/7/23 9:55
   * @param        :
   * @return       :
   */
  putAlarmFilterCounts: function (selectList) {
    return Axios.put(ALARM_FILTER_TOTAL, selectList, REQUEST_CONFIG)
  },
  // 获取告警过滤列表 cxf/nms/alarm/alarmfilterconfig
  getAllAlarmFilterList: function () {
    return Axios.get(ALARM_FILTER_ADMQ)
  },

  // 改
  modifyAlarmFilter: function (alarmfilter) {
    return Axios.put(ALARM_FILTER_ADMQ, alarmfilter, REQUEST_CONFIG)
  },

  // 增
  addAlarmFilter: function (alarmfilter) {
    return Axios.post(ALARM_FILTER_ADMQ, alarmfilter, REQUEST_CONFIG)
  },
  // 删除
  deleteAlarmFilter: function (deletelist) {
    return Axios.delete(ALARM_FILTER_ADMQ, {
      data: deletelist,
      headers: {'Content-Type': 'application/json', 'Encoding': 'utf-8'}
    })
  }
}

function AlarmFilterConfigAPI (websocketService = null) {
  return Object.freeze(Object.assign(
    {
      // object methods comes here
    },
    staticMethods
  ))
}
// inject static methods
Object.assign(AlarmFilterConfigAPI, staticMethods)
export default AlarmFilterConfigAPI
