chore: commit oxfmt formatting changes and verify artifacts
This commit is contained in:
@@ -4,9 +4,21 @@ import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
|
||||
import {
|
||||
Student, Room, Occupancy, RoomExpense, PersonalExpense,
|
||||
Bill, BillItem, User, OperationLog, Deposit, Classroom,
|
||||
Tenant, ClassroomRental, Permission, Role,
|
||||
Student,
|
||||
Room,
|
||||
Occupancy,
|
||||
RoomExpense,
|
||||
PersonalExpense,
|
||||
Bill,
|
||||
BillItem,
|
||||
User,
|
||||
OperationLog,
|
||||
Deposit,
|
||||
Classroom,
|
||||
Tenant,
|
||||
ClassroomRental,
|
||||
Permission,
|
||||
Role,
|
||||
} from './entities';
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
import { RbacModule } from './rbac/rbac.module';
|
||||
@@ -26,19 +38,33 @@ import { ClassroomRentalsModule } from './classroom-rentals/classroom-rentals.mo
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({ isGlobal: true }),
|
||||
ThrottlerModule.forRoot([{
|
||||
ttl: 60000, // 60秒窗口
|
||||
limit: 100, // 普通接口每分钟100次
|
||||
}]),
|
||||
ThrottlerModule.forRoot([
|
||||
{
|
||||
ttl: 60000, // 60秒窗口
|
||||
limit: 100, // 普通接口每分钟100次
|
||||
},
|
||||
]),
|
||||
TypeOrmModule.forRootAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
useFactory: (config: ConfigService): any => {
|
||||
const dbType = config.get('DB_TYPE', 'sqlite');
|
||||
const allEntities = [
|
||||
Student, Room, Occupancy, RoomExpense, PersonalExpense,
|
||||
Bill, BillItem, User, OperationLog, Deposit, Classroom,
|
||||
Tenant, ClassroomRental, Permission, Role,
|
||||
Student,
|
||||
Room,
|
||||
Occupancy,
|
||||
RoomExpense,
|
||||
PersonalExpense,
|
||||
Bill,
|
||||
BillItem,
|
||||
User,
|
||||
OperationLog,
|
||||
Deposit,
|
||||
Classroom,
|
||||
Tenant,
|
||||
ClassroomRental,
|
||||
Permission,
|
||||
Role,
|
||||
];
|
||||
if (dbType === 'mysql') {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user