function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

import BaseComDeployApis from "../apis";
import { axios } from '@choerodon/boot';

var BaseComDeployServices = /*#__PURE__*/function () {
  function BaseComDeployServices() {
    _classCallCheck(this, BaseComDeployServices);
  }

  _createClass(BaseComDeployServices, null, [{
    key: "axiosGetParamsSetting",
    value: function axiosGetParamsSetting(middlewareName, deployPattern, deployModel) {
      return axios.get(BaseComDeployApis.getParamsSettingApi(middlewareName, deployPattern, deployModel));
    }
  }, {
    key: "axiosGetServiceVersion",
    value: function axiosGetServiceVersion(name) {
      return axios.get(BaseComDeployApis.getServiceVersionApi(name));
    }
  }, {
    key: "axiosPostBaseDeployMySqlEnvApi",
    value: function axiosPostBaseDeployMySqlEnvApi(projectId, data) {
      return axios.post(BaseComDeployApis.getBaseDeployMySqlEnvAPi(projectId), data);
    }
  }, {
    key: "axiosPostBaseDeployMySqlHostApi",
    value: function axiosPostBaseDeployMySqlHostApi(projectId, data) {
      return axios.post(BaseComDeployApis.getBaseDployMySqlHostApi(projectId), data);
    }
  }, {
    key: "axiosGetMiddlewareValue",
    value: function axiosGetMiddlewareValue(appVersionId, mode) {
      return axios.get(BaseComDeployApis.getMiddleValueApi(appVersionId, mode));
    }
  }, {
    key: "axiosPostDeployMiddleware",
    value: function axiosPostDeployMiddleware(projectId, data) {
      return axios.post(BaseComDeployApis.getDeployMiddlewareApi(projectId), data);
    }
  }, {
    key: "axiosPostHostList",
    value: function axiosPostHostList(projectId) {
      return axios.post(BaseComDeployApis.getHostListApi(projectId), {
        params: [],
        searchParam: {
          type: 'deploy'
        }
      });
    }
  }, {
    key: "axiosPostTestHost",
    value: function axiosPostTestHost(projectId, data) {
      return axios.post(BaseComDeployApis.getTestHostApi(projectId), data);
    }
  }, {
    key: "axiosPostDeployHost",
    value: function axiosPostDeployHost(projectId, data) {
      return axios.post(BaseComDeployApis.getDeployHostApi(projectId), data);
    }
  }]);

  return BaseComDeployServices;
}();

export { BaseComDeployServices as default };