UNPKG

youzanyun-devtool-worker

Version:

36 lines (35 loc) 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const spring4js_nodejs_1 = require("spring4js-nodejs"); const index_1 = tslib_1.__importDefault(require("./design-platform/index")); let ActionDesignPlatformService = class ActionDesignPlatformService { async processRequest(ctx, next) { let actionType; if (ctx.path === '/v4/deco/developer-decorate') { actionType = 'dpDeveloperDecorate'; } else if (ctx.path === '/cloud/diy/api/design-platform/showcase/template') { actionType = 'dpShowcaseTemplate'; } else if (ctx.path === '/cloud/diy/api/design-platform/showcase/template/save') { actionType = 'saveDpShowcaseTemplate'; } else { return false; } if (!this.webPort) { this.webPort = this.configService.getWebPort(); } let actionHandler = index_1.default.getAction(actionType); await actionHandler.run(ctx, this.webPort); return true; } }; tslib_1.__decorate([ (0, spring4js_nodejs_1.Resource)() ], ActionDesignPlatformService.prototype, "configService", void 0); ActionDesignPlatformService = tslib_1.__decorate([ (0, spring4js_nodejs_1.Service)() ], ActionDesignPlatformService); exports.default = ActionDesignPlatformService;