youzanyun-devtool-worker
Version:
- web - ws - proxy
34 lines (33 loc) • 1.41 kB
JavaScript
;
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 WorkbenchController = class WorkbenchController extends BaseController_1.default {
constructor() {
super(...arguments);
this.workbenchId = 0;
}
async getWorkbenchId(ctx, next) {
this.workbenchId += 1;
return this.workbenchId;
}
async updateWebviewInfo(ctx, next) {
const { contentType, url, hasNavigator, workbenchId, cookie } = ctx.request.body;
await this.contentWindowService.showContent(workbenchId, { contentType, url, hasNavigator, cookie });
return true;
}
};
tslib_1.__decorate([
spring4js_nodejs_1.Resource()
], WorkbenchController.prototype, "contentWindowService", void 0);
tslib_1.__decorate([
spring4js_nodejs_1.Path("getWorkbenchId", spring4js_nodejs_1.HttpMethod.GET)
], WorkbenchController.prototype, "getWorkbenchId", null);
tslib_1.__decorate([
spring4js_nodejs_1.Path("updateWebviewInfo", spring4js_nodejs_1.HttpMethod.POST)
], WorkbenchController.prototype, "updateWebviewInfo", null);
WorkbenchController = tslib_1.__decorate([
spring4js_nodejs_1.Controller("/api/workbench")
], WorkbenchController);
exports.default = WorkbenchController;