CDPAPI.js 781 Bytes
Newer Older
YazhouChen's avatar
YazhouChen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
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