feat(core): 新增BusinessModule并替换原有FEATURE_MODULES引入方式,优化模块结构

This commit is contained in:
dayjoy
2026-03-13 17:25:54 +08:00
parent db6271e36b
commit cfdc5875ca
4 changed files with 12 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ import { ConfigModule, ConfigService } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
import databaseConfig from '@/config/database.config';
import { FEATURE_MODULES } from '@/feature-modules';
import { BusinessModule } from '@/modules/business.module';
@Module({
imports: [
@@ -32,7 +32,7 @@ import { FEATURE_MODULES } from '@/feature-modules';
},
],
}),
...FEATURE_MODULES,
BusinessModule,
],
providers: [
{

View File

@@ -8,9 +8,10 @@ import { Observable, map } from 'rxjs';
import { ApiResponse } from '@/common/interfaces/api-response.interface';
@Injectable()
export class TransformInterceptor<T>
implements NestInterceptor<T, ApiResponse<T>>
{
export class TransformInterceptor<T> implements NestInterceptor<
T,
ApiResponse<T>
> {
intercept(
_context: ExecutionContext,
next: CallHandler<T>,

View File

@@ -1 +0,0 @@
export const FEATURE_MODULES = [];

View File

@@ -0,0 +1,6 @@
import { Module } from '@nestjs/common';
@Module({
imports: [],
})
export class BusinessModule {}