feat: 完成配置中心重构和命名规范优化
- 重构config层为配置中心架构,支持动态配置管理 - 统一core层命名规范(event-bus→event, circuit-breaker→breaker, domain-sdk→sdk) - 修复数据库连接配置路径问题 - 实现配置中心完整功能:系统配置、动态配置、配置验证、统计 - 优化目录结构,为微服务架构做准备 - 修复TypeScript编译错误和依赖注入问题
This commit is contained in:
35
wwjcloud/src/config/core/configModule.ts
Normal file
35
wwjcloud/src/config/core/configModule.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule as NestConfigModule } from '@nestjs/config';
|
||||
import { ConfigController } from '../controllers/configController';
|
||||
import { ConfigCenterService } from '../services/configCenterService';
|
||||
import { ConfigValidationService } from '../services/configValidationService';
|
||||
import { DynamicConfigService } from '../services/dynamicConfigService';
|
||||
import { DocsNavigationController } from '../controllers/docsNavigationController';
|
||||
import { appConfig } from './appConfig';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
NestConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
load: [() => appConfig],
|
||||
envFilePath: ['.env.local', '.env.development', '.env.production', '.env'],
|
||||
}),
|
||||
],
|
||||
controllers: [ConfigController, DocsNavigationController],
|
||||
providers: [
|
||||
ConfigCenterService,
|
||||
ConfigValidationService,
|
||||
DynamicConfigService,
|
||||
{
|
||||
provide: 'APP_CONFIG',
|
||||
useValue: appConfig,
|
||||
},
|
||||
],
|
||||
exports: [
|
||||
ConfigCenterService,
|
||||
ConfigValidationService,
|
||||
DynamicConfigService,
|
||||
'APP_CONFIG',
|
||||
],
|
||||
})
|
||||
export class ConfigModule {}
|
||||
Reference in New Issue
Block a user