mirror of
https://github.com/certd/certd.git
synced 2026-05-17 13:57:31 +08:00
20 lines
484 B
TypeScript
20 lines
484 B
TypeScript
|
|
import { Autoload, Init, Inject, Scope, ScopeEnum } from "@midwayjs/core";
|
||
|
|
import { logger } from "@certd/basic";
|
||
|
|
import { PluginService } from "../plugin/service/plugin-service.js";
|
||
|
|
|
||
|
|
@Autoload()
|
||
|
|
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||
|
|
export class AutoBLoadPlugins {
|
||
|
|
@Inject()
|
||
|
|
pluginService: PluginService;
|
||
|
|
|
||
|
|
|
||
|
|
@Init()
|
||
|
|
async init() {
|
||
|
|
logger.info('加载插件开始');
|
||
|
|
await this.pluginService.registerFromDb()
|
||
|
|
logger.info('加载插件完成');
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|