增加了port的注入导出
This commit is contained in:
parent
b0191b0b08
commit
4cc77996a8
|
|
@ -9,7 +9,7 @@ const triggers_1 = require("oak-domain/lib/triggers");
|
|||
const uuid_1 = require("oak-domain/lib/utils/uuid");
|
||||
const types_1 = require("oak-domain/lib/types");
|
||||
const DbStore_1 = require("./DbStore");
|
||||
const index_1 = tslib_1.__importDefault(require("oak-common-aspect/lib/index"));
|
||||
const index_1 = tslib_1.__importStar(require("oak-common-aspect/lib/index"));
|
||||
function initTriggers(dbStore, path) {
|
||||
const triggers = require(`${path}/lib/triggers/index`).default;
|
||||
const checkers = require(`${path}/lib/checkers/index`).default;
|
||||
|
|
@ -94,9 +94,12 @@ class AppLoader extends types_1.AppLoader {
|
|||
if (!initialize) {
|
||||
initTriggers(this.dbStore, path);
|
||||
}
|
||||
const { importations, exportations } = require(`${path}/lib/ports/index`);
|
||||
(0, index_1.registerPorts)(importations || [], exportations || []);
|
||||
this.dbStore.connect();
|
||||
}
|
||||
async unmount() {
|
||||
(0, index_1.clearPorts)();
|
||||
this.dbStore.disconnect();
|
||||
}
|
||||
async execAspect(name, context, params) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
|||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { AppLoader as GeneralAppLoader, Trigger, Checker, Aspect, RowStore, Context, EntityDict, Watcher, BBWatcher, WBWatcher } from "oak-domain/lib/types";
|
||||
import { DbStore } from "./DbStore";
|
||||
import generalAspectDict from 'oak-common-aspect/lib/index';
|
||||
import generalAspectDict, { clearPorts, registerPorts } from 'oak-common-aspect/lib/index';
|
||||
import { MySQLConfiguration } from 'oak-db/lib/MySQL/types/Configuration';
|
||||
import { AsyncContext } from "oak-domain/lib/store/AsyncRowStore";
|
||||
|
||||
|
|
@ -122,10 +122,13 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Async
|
|||
if (!initialize) {
|
||||
initTriggers(this.dbStore, path);
|
||||
}
|
||||
const { importations, exportations } = require(`${path}/lib/ports/index`);
|
||||
registerPorts(importations || [], exportations || []);
|
||||
this.dbStore.connect();
|
||||
}
|
||||
|
||||
async unmount() {
|
||||
clearPorts();
|
||||
this.dbStore.disconnect();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue