import Axios from 'axios'

import {
  CDP_ADQ, REQUEST_CONFIG
} from "../../../utils/RequestUrls";

var staticMethods = {
  // 获取所有CDP业务
  getCDPCollection: function(){
    return Axios.get(CDP_ADQ);
  },

  // 添加CDP业务
  postAddCDP: function (cdpObj) {
    return Axios.post(CDP_ADQ,cdpObj,REQUEST_CONFIG);
  },

  // 删除CDP业务
  deleteDeleteCDP: function (cdpKeyList) {
    return Axios.delete(CDP_ADQ,{
      data:cdpKeyList,
      headers:{'Content-Type':'application/json','Encoding':'utf-8'}
    });
  },
};

function CDPAPI (websocketService = null) {

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