mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 03:19:18 +08:00
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { AuthModule } from './modules/auth/auth.module';
|
|
import { CustomerModule } from './modules/customer/customer.module';
|
|
import { DashboardModule } from './modules/dashboard/dashboard.module';
|
|
import { LicenseModule } from './modules/license/license.module';
|
|
import { LcAdmin } from './entities/lc-admin.entity';
|
|
import { LcActivationLog } from './entities/lc-activation-log.entity';
|
|
import { LcCustomer } from './entities/lc-customer.entity';
|
|
import { LcLicense } from './entities/lc-license.entity';
|
|
import { LcOperLog } from './entities/lc-oper-log.entity';
|
|
import { AdminSeedService } from './common/admin-seed.service';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({ isGlobal: true }),
|
|
TypeOrmModule.forRoot({
|
|
type: 'mysql',
|
|
host: process.env.DB_HOST || 'localhost',
|
|
port: Number(process.env.DB_PORT || 3306),
|
|
username: process.env.DB_USERNAME || 'root',
|
|
password: process.env.DB_PASSWORD || '',
|
|
database: process.env.DB_DATABASE || 'ecom_license_dev',
|
|
entities: [LcAdmin, LcCustomer, LcLicense, LcActivationLog, LcOperLog],
|
|
synchronize: process.env.DB_SYNC === 'true',
|
|
timezone: '+08:00',
|
|
}),
|
|
TypeOrmModule.forFeature([LcAdmin]),
|
|
AuthModule,
|
|
CustomerModule,
|
|
LicenseModule,
|
|
DashboardModule,
|
|
],
|
|
providers: [AdminSeedService],
|
|
})
|
|
export class AppModule {}
|