chore: src/modules/plugin/event/app.ts

This commit is contained in:
2026-07-01 17:56:59 +08:00
parent dbd53acc8d
commit 3542697746
+44
View File
@@ -0,0 +1,44 @@
import { CoolEvent, Event } from '@cool-midway/core';
import { CachingFactory, MidwayCache } from '@midwayjs/cache-manager';
import {
App,
Config,
ILogger,
Inject,
InjectClient,
Logger,
} from '@midwayjs/core';
import { IMidwayKoaApplication } from '@midwayjs/koa';
import { PLUGIN_CACHE_KEY, PluginCenterService } from '../service/center';
import { PluginTypesService } from '../service/types';
/**
* 插件事件
*/
@CoolEvent()
export class PluginAppEvent {
@Logger()
coreLogger: ILogger;
@Config('module')
config;
@App()
app: IMidwayKoaApplication;
@InjectClient(CachingFactory, 'default')
midwayCache: MidwayCache;
@Inject()
pluginCenterService: PluginCenterService;
@Inject()
pluginTypesService: PluginTypesService;
@Event('onServerReady')
async onServerReady() {
await this.midwayCache.set(PLUGIN_CACHE_KEY, []);
this.pluginCenterService.init();
// this.pluginTypesService.reGenerate();
}
}