feat(core): 新增BusinessModule并替换原有FEATURE_MODULES引入方式,优化模块结构
This commit is contained in:
@@ -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: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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>,
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export const FEATURE_MODULES = [];
|
|
||||||
6
src/modules/business.module.ts
Normal file
6
src/modules/business.module.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [],
|
||||||
|
})
|
||||||
|
export class BusinessModule {}
|
||||||
Reference in New Issue
Block a user