lin-cms-test
Version:
The core library of Lin CMS, this package is just for test!
34 lines (33 loc) • 756 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_1 = require("lodash");
/**
* 插件类,一个插件包含自己的业务 (redprint),自己的模型 (model)
* 自己的校验层,视图层
*/
class Plugin {
constructor(name) {
this.models = {};
this.controllers = {};
this.name = name;
}
/**
* addModel
*/
addModel(name, model) {
lodash_1.set(this.models, name, model);
}
/**
* getModel
*/
getModel(name) {
return lodash_1.get(this.models, name);
}
/**
* addController
*/
addController(name, controller) {
lodash_1.set(this.controllers, name, controller);
}
}
exports.Plugin = Plugin;