fix(GOV-009): 完成脚手架审查整改
This commit is contained in:
@@ -1,4 +1,18 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { type DynamicModule, Module } from '@nestjs/common';
|
||||
|
||||
import type { WorkerRuntimeConfig } from '../../../libs/config/src/runtime-config';
|
||||
|
||||
/** Worker 的最小权限配置令牌,仅包含采集、持久化、消息与 AI 处理所需配置。 */
|
||||
export const WORKER_RUNTIME_CONFIG = Symbol('WORKER_RUNTIME_CONFIG');
|
||||
|
||||
@Module({})
|
||||
export class WorkerModule {}
|
||||
export class WorkerModule {
|
||||
/** 将入口校验后的 Worker 配置注册进当前进程容器。 */
|
||||
static register(config: WorkerRuntimeConfig): DynamicModule {
|
||||
return {
|
||||
module: WorkerModule,
|
||||
providers: [{ provide: WORKER_RUNTIME_CONFIG, useValue: config }],
|
||||
exports: [WORKER_RUNTIME_CONFIG],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user