youzanyun-devtool-worker
Version:
99 lines (98 loc) • 4.42 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 CustomCompsController = class CustomCompsController extends BaseController_1.default {
async createDevelopProject(ctx, next) {
const { appId, designAppId } = ctx.query;
const result = await this.customCompsService.createDevelopProject({ appId, designAppId });
return result;
}
async updateProject(ctx, next) {
const { appId } = ctx.request.body;
const result = await this.customCompsService.updateProject({ appId });
return result;
}
async getCompsByAppName(ctx, next) {
const params = ctx.query;
const result = await this.customCompsService.getCompsByAppName(params);
return result;
}
async saveComp(ctx, next) {
const params = ctx.request.body;
const result = await this.customCompsService.saveComp(params);
return result;
}
async updateComp(ctx, next) {
const params = ctx.request.body;
const result = await this.customCompsService.updateComp(params);
ctx.body = result;
}
async deleteComp(ctx, next) {
const params = ctx.query;
const result = await this.customCompsService.deleteComp(params);
return result;
}
async batchUpdate(ctx, next) {
const params = ctx.request.body;
const result = await this.dpRequestService.batchUpdate(params);
return result;
}
async batchChangeGroup(ctx, next) {
const params = ctx.request.body;
const result = await this.dpRequestService.batchChangeGroup(params);
return result;
}
async inBrandWhiteList(ctx) {
const { appId } = ctx.query;
let brandIsvAppId = await this.customApiService.getBrandIsvAppIdWhiteList();
return brandIsvAppId.some(item => (item === null || item === void 0 ? void 0 : item.toString()) === appId);
}
};
tslib_1.__decorate([
(0, spring4js_nodejs_1.Resource)()
], CustomCompsController.prototype, "configService", void 0);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Resource)()
], CustomCompsController.prototype, "userService", void 0);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Resource)()
], CustomCompsController.prototype, "customCompsService", void 0);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Resource)()
], CustomCompsController.prototype, "dpRequestService", void 0);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Resource)()
], CustomCompsController.prototype, "customApiService", void 0);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("project/create", spring4js_nodejs_1.HttpMethod.GET)
], CustomCompsController.prototype, "createDevelopProject", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("project/update", spring4js_nodejs_1.HttpMethod.POST)
], CustomCompsController.prototype, "updateProject", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("comp/list", spring4js_nodejs_1.HttpMethod.GET)
], CustomCompsController.prototype, "getCompsByAppName", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("comp/save", spring4js_nodejs_1.HttpMethod.POST)
], CustomCompsController.prototype, "saveComp", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("comp/update", spring4js_nodejs_1.HttpMethod.POST)
], CustomCompsController.prototype, "updateComp", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("comp/delete", spring4js_nodejs_1.HttpMethod.DELETE)
], CustomCompsController.prototype, "deleteComp", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("comp/batch-update", spring4js_nodejs_1.HttpMethod.POST)
], CustomCompsController.prototype, "batchUpdate", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("comp/batch-change-group", spring4js_nodejs_1.HttpMethod.POST)
], CustomCompsController.prototype, "batchChangeGroup", null);
tslib_1.__decorate([
(0, spring4js_nodejs_1.Path)("comp/in-brand-white-list", spring4js_nodejs_1.HttpMethod.GET)
], CustomCompsController.prototype, "inBrandWhiteList", null);
CustomCompsController = tslib_1.__decorate([
(0, spring4js_nodejs_1.Controller)("/api/design-platform")
], CustomCompsController);
exports.default = CustomCompsController;