UNPKG

youzanyun-devtool-worker

Version:

- web - ws - proxy

67 lines (66 loc) 2.95 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")); let DatabaseController = class DatabaseController extends BaseController_1.default { async downloadMySQL(ctx, next) { let { workbenchId, projectId } = ctx.query; return await this.databaseService.downloadMysql({ workbenchId, projectId }); } async downloadRedis(ctx, next) { let { workbenchId, projectId } = ctx.query; return await this.databaseService.downloadRedis({ workbenchId, projectId }); } async startMySql(ctx, next) { let { workbenchId, projectId } = ctx.query; return await this.databaseService.startMysql({ workbenchId, projectId }); } async stopMySql(ctx, next) { let { workbenchId, projectId } = ctx.query; return await this.databaseService.stopMysql({ workbenchId, projectId }); } async startRedis(ctx, next) { let { workbenchId, projectId } = ctx.query; return await this.databaseService.startRedis({ workbenchId, projectId }); } async stopRedis(ctx, next) { let { workbenchId, projectId } = ctx.query; return await this.databaseService.stopRedis({ workbenchId, projectId }); } async syncMysql(ctx, next) { let { workbenchId, projectId, type } = ctx.query; return await this.databaseService.syncMysql({ workbenchId, projectId, type }); } }; tslib_1.__decorate([ spring4js_nodejs_1.Resource() ], DatabaseController.prototype, "databaseService", void 0); tslib_1.__decorate([ spring4js_nodejs_1.Path("download-mysql", spring4js_nodejs_1.HttpMethod.GET) ], DatabaseController.prototype, "downloadMySQL", null); tslib_1.__decorate([ spring4js_nodejs_1.Path("download-redis", spring4js_nodejs_1.HttpMethod.GET) ], DatabaseController.prototype, "downloadRedis", null); tslib_1.__decorate([ spring4js_nodejs_1.Path("start-mysql", spring4js_nodejs_1.HttpMethod.GET) ], DatabaseController.prototype, "startMySql", null); tslib_1.__decorate([ spring4js_nodejs_1.Path("stop-mysql", spring4js_nodejs_1.HttpMethod.GET) ], DatabaseController.prototype, "stopMySql", null); tslib_1.__decorate([ spring4js_nodejs_1.Path("start-redis", spring4js_nodejs_1.HttpMethod.GET) ], DatabaseController.prototype, "startRedis", null); tslib_1.__decorate([ spring4js_nodejs_1.Path("stop-redis", spring4js_nodejs_1.HttpMethod.GET) ], DatabaseController.prototype, "stopRedis", null); tslib_1.__decorate([ spring4js_nodejs_1.Path("sync-mysql", spring4js_nodejs_1.HttpMethod.GET) ], DatabaseController.prototype, "syncMysql", null); DatabaseController = tslib_1.__decorate([ spring4js_nodejs_1.Controller("/api/common-tool") ], DatabaseController); exports.default = DatabaseController;