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

View File

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