import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
// 导入所有控制器
import { AllModules } from './modules';
import { CoreModule } from './core/core.module';
import { AppConfigParams } from './config';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './user.module';

/**
 * 默认模块
 *
 * @author chitanda
 * @date 2021-08-10 14:08:34
 * @export
 * @class AppModule
 */
@Module({
  imports: [
    CoreModule,
    ConfigModule.forRoot({
      isGlobal: true,
      load: [AppConfigParams],
    }),
    ...AllModules,
    UserModule,
  ],
  exports: [ConfigModule, UserModule],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
