astroboy
Version:
Astroboy(阿童木)is a Nodejs SFB(Separation of Front and Back ends) framework, built on koa2.
41 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* ## Astroboy Base Class
* - `ctx` Context 请求上下文对象
* - `app` Koa Application 实例对象
* - `config` 应用配置对象
*
* @author Big Mogician
* @export
* @class BaseClass
* @implements {IAstroboyCtxExtends<DEFINE>}
* @template DEFINE Framework Definition, default is `IAstroboyFrameworkDefine`
*/
class BaseClass {
constructor(ctx) {
this.ctx = ctx;
this.app = (ctx && ctx.app);
this.config = (ctx && ctx.app && ctx.app.config);
}
getConfig(...args) {
return this.ctx.getConfig(...args);
}
getLib(...args) {
return this.ctx.getLib(...args);
}
getServiceClass(...args) {
return this.ctx.getServiceClass(...args);
}
getService(...args) {
return this.ctx.getService(...args);
}
callService(...args) {
return this.ctx.callService(...args);
}
invokeServiceMethod(...args) {
return this.ctx.invokeServiceMethod(...args);
}
}
exports.BaseClass = BaseClass;
//# sourceMappingURL=BaseClass.js.map