UNPKG

youzanyun-devtool-worker

Version:

123 lines (122 loc) 5.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const spring4js_nodejs_1 = require("spring4js-nodejs"); const BaseController_1 = tslib_1.__importDefault(require("../BaseController")); const sd = require("silly-datetime"); let ExtensionController = class ExtensionController extends BaseController_1.default { async getExtensionList(ctx, next) { let totalBep = await this.bepService.getTotalBep(); return totalBep; } async getExtensionParams(ctx, next) { let { id } = ctx.query; let bepDetail = await this.documentCenterApiService.getBepDetail(id); let { inParam, outParam } = bepDetail; let inExample = this.bepService.generateBepDataExample(inParam); outParam.name = "return"; let outExample = this.bepService.generateBepDataExample(outParam); bepDetail.inExample = inExample[inParam.name]; bepDetail.outExample = outExample.return; return bepDetail; } async getHistoryData(ctx, next) { let { projectId, bepId } = ctx.query; let history = await this.bepService.getBepTestHistory(projectId, bepId); return history; } async sendParams(ctx, next) { const { param, projectId, item, selectedImplement } = ctx.request.body; return await this.bepService.testLocalBep(projectId, item, selectedImplement, param); } async generateBepCode(ctx, next) { const { projectId, page, extId } = ctx.request.body; if (page == 1) { await this.nodeJsProjectService.generateBepFile(projectId, extId); } else { await this.nodeJsProjectService.generateMepFile(projectId, extId); } return true; } async getMessageList(ctx, next) { let data = await this.mepService.getAllMep(); return data; } async getMepParamType(ctx, next) { let { bizType } = ctx.query; let paramType = await this.documentCenterApiService.getMepParamType(bizType); let paramExample = this.mepService.generateMepCallExample(paramType); paramType.paramExample = paramExample[paramType.name]; return paramType; } async getMsgHistoryData(ctx, next) { let { projectId, mepId } = ctx.query; let data = this.mepService.getMepTestHistory(projectId, mepId); return data; } async sendMsgParams(ctx, next) { const { param, projectId, item } = ctx.request.body; return await this.mepService.testLocalMep(projectId, item, param); } async downloadDocker(ctx, next) { let { workbenchId, projectId, arg } = ctx.query; return await this.backendHelperService.downloadDocker({ workbenchId, projectId, arg }); } }; tslib_1.__decorate([ (0, spring4js_nodejs_1.Resource)() ], ExtensionController.prototype, "configService", void 0); tslib_1.__decorate([ (0, spring4js_nodejs_1.Resource)() ], ExtensionController.prototype, "documentCenterApiService", void 0); tslib_1.__decorate([ (0, spring4js_nodejs_1.Resource)() ], ExtensionController.prototype, "bepService", void 0); tslib_1.__decorate([ (0, spring4js_nodejs_1.Resource)() ], ExtensionController.prototype, "mepService", void 0); tslib_1.__decorate([ (0, spring4js_nodejs_1.Resource)() ], ExtensionController.prototype, "nodeJsProjectService", void 0); tslib_1.__decorate([ (0, spring4js_nodejs_1.Resource)() ], ExtensionController.prototype, "backendHelperService", void 0); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("bep/list", spring4js_nodejs_1.HttpMethod.GET) ], ExtensionController.prototype, "getExtensionList", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("bep/detail", spring4js_nodejs_1.HttpMethod.GET) ], ExtensionController.prototype, "getExtensionParams", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("bep/history", spring4js_nodejs_1.HttpMethod.GET) ], ExtensionController.prototype, "getHistoryData", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("bep/test", spring4js_nodejs_1.HttpMethod.POST) ], ExtensionController.prototype, "sendParams", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("generate", spring4js_nodejs_1.HttpMethod.POST) ], ExtensionController.prototype, "generateBepCode", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("mep/list", spring4js_nodejs_1.HttpMethod.GET) ], ExtensionController.prototype, "getMessageList", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("mep/detail", spring4js_nodejs_1.HttpMethod.GET) ], ExtensionController.prototype, "getMepParamType", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("mep/history", spring4js_nodejs_1.HttpMethod.GET) ], ExtensionController.prototype, "getMsgHistoryData", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("mep/test", spring4js_nodejs_1.HttpMethod.POST) ], ExtensionController.prototype, "sendMsgParams", null); tslib_1.__decorate([ (0, spring4js_nodejs_1.Path)("downloadDocker", spring4js_nodejs_1.HttpMethod.GET) ], ExtensionController.prototype, "downloadDocker", null); ExtensionController = tslib_1.__decorate([ (0, spring4js_nodejs_1.Controller)("/api/extension-point") ], ExtensionController); exports.default = ExtensionController;