mirror of
https://github.com/certd/certd.git
synced 2026-04-16 05:50:50 +08:00
21 lines
545 B
TypeScript
21 lines
545 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.registerFromLocal("./metadata")
|
|
await this.pluginService.registerFromDb()
|
|
logger.info('加载插件完成');
|
|
|
|
}
|
|
}
|