import {SERVICETYPE_ADMQ, SERVICETYPE_QUERY, REQUEST_CONFIG} from "../../../utils/RequestUrls";
import Axios from 'axios'

var staticMethods = {
  //获取所有serviceType
  getServiceTypeCollection: function(){
    return Axios.get(SERVICETYPE_ADMQ);
  },

  //新增serviceType
  postServiceTypeAdd:function (serviceType) {
    return Axios.post(SERVICETYPE_ADMQ, serviceType, REQUEST_CONFIG);
  },

  //修改serviceType
  putServiceTypeUpdate:function (serviceType) {
    return Axios.put(SERVICETYPE_ADMQ, serviceType, REQUEST_CONFIG);
  },

  //删除serviceType
  deleteServiceTypeDelete:function (serviceTypeKeyList) {
    return Axios.delete(SERVICETYPE_ADMQ,{
      data:serviceTypeKeyList,
      headers:{'Content-Type':'application/json','Encoding':'utf-8'}
    });
  },
  //条件查询serviceType
  getServiceTypeByCondition:function (selectList) {
    return Axios.put(SERVICETYPE_QUERY, selectList, REQUEST_CONFIG);
  }
}

function ServiceTypeAPI (websocketService = null) {

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