RMS.API.Web/SwaggerUI/lib/swagger.js

(开头部分) 17KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

// Generated by CoffeeScript 1.3.3
(function() {
  var SwaggerApi, SwaggerOperation, SwaggerRequest, SwaggerResource,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  SwaggerApi = (function() {

    SwaggerApi.prototype.discoveryUrl = "http://api.wordnik.com/v4/resources.json";

    SwaggerApi.prototype.debug = false;

    SwaggerApi.prototype.api_key = null;

    SwaggerApi.prototype.basePath = null;

    function SwaggerApi(options) {
      if (options == null) {
        options = {};
      }
      if (options.discoveryUrl != null) {
        this.discoveryUrl = options.discoveryUrl;
      }
      if (options.debug != null) {
        this.debug = options.debug;
      }
      this.apiKeyName = options.apiKeyName != null ? options.apiKeyName : 'api_key';
      if (options.apiKey != null) {
        this.api_key = options.apiKey;
      }
      if (options.api_key != null) {
        this.api_key = options.api_key;
      }
      if (options.verbose != null) {
        this.verbose = options.verbose;
      }
      this.supportHeaderParams = options.supportHeaderParams != null ? options.supportHeaderParams : false;
      this.supportedSubmitMethods = options.supportedSubmitMethods != null ? options.supportedSubmitMethods : ['get'];
      if (options.success != null) {
        this.success = options.success;
      }
      this.failure = options.failure != null ? options.failure : function() {};
      this.progress = options.progress != null ? options.progress : function() {};
      this.discoveryUrl = this.suffixApiKey(this.discoveryUrl);
      if (options.success != null) {
        this.build();
      }
    }

    SwaggerApi.prototype.build = function() {
      var _this = this;
      this.progress('fetching resource list: ' + this.discoveryUrl);
      return jQuery.getJSON(this.discoveryUrl, function(response) {
        var res, resource, _i, _j, _len, _len1, _ref, _ref1;
        if ((response.basePath != null) && jQuery.trim(response.basePath).length > 0) {
          _this.basePath = response.basePath;
          if (_this.basePath.match(/^HTTP/i) == null) {
            _this.fail("discoveryUrl basePath must be a URL.");
          }
          _this.basePath = _this.basePath.replace(/\/$/, '');
        } else {
后面还有 447 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。