23 lines
846 B
TypeScript
23 lines
846 B
TypeScript
import { Module, OnApplicationBootstrap } from "@nestjs/common";
|
|
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
|
|
import { Role } from "./entities/role.entity";
|
|
import { User } from "./entities/user.entity";
|
|
import { UserRepository } from "./providers/users.repository";
|
|
import { UsersService } from "./providers/users.service";
|
|
import { UsersController } from "./users.controller";
|
|
import { RoleRepository } from "./providers/roles.repository";
|
|
|
|
@Module({
|
|
imports: [TypeOrmModule.forFeature([User, Role])],
|
|
providers: [UsersService, UserRepository, RoleRepository],
|
|
controllers: [UsersController],
|
|
exports: [UsersService, TypeOrmModule],
|
|
})
|
|
export class UsersModule implements OnApplicationBootstrap {
|
|
constructor(private userService: UsersService) {}
|
|
async onApplicationBootstrap() {
|
|
await this.userService.roleSeeder();
|
|
}
|
|
}
|