TopologyAPI.js 655 Bytes
import Axios from 'axios'

import {REQUEST_CONFIG, TOPOLOGY_ADMQ} from '../../utils/RequestUrls'

var staticMethods = {

  // 获取所有拓扑信息
  getTopologyCollection: function () {
    return Axios.get(TOPOLOGY_ADMQ)
  },

  // 保存拓扑图信息
  postSaveTopologyCollection: function (topologyCollection) {
    return Axios.post(TOPOLOGY_ADMQ, topologyCollection, REQUEST_CONFIG)
  }
}

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