From 1d149b599b05d2d5cf7e56033d6f2e22ffbfbf51 Mon Sep 17 00:00:00 2001 From: Felipe Rodrigues de Santana Freitag Date: Thu, 30 Nov 2023 02:47:16 -0300 Subject: [PATCH] feat: add ranking module and update the app module --- src/app.module.ts | 2 ++ src/ranking/ranking.module.ts | 18 ++++++++++++++++++ src/user/entities/user.entity.ts | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 src/ranking/ranking.module.ts diff --git a/src/app.module.ts b/src/app.module.ts index d029b2e..28f6c3c 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -13,6 +13,7 @@ import { AskModule } from "./ask/ask.module"; import { StaticModule } from "./assets/assets.module"; import { CommentModule } from "./comment/comment.module"; import { ScoreModule } from "./score/score.module"; +import { RankingModule } from "./ranking/ranking.module"; @Module({ imports: [ @@ -45,6 +46,7 @@ import { ScoreModule } from "./score/score.module"; TestModule, CommentModule, ScoreModule, + RankingModule, ], controllers: [], providers: [], diff --git a/src/ranking/ranking.module.ts b/src/ranking/ranking.module.ts new file mode 100644 index 0000000..617b59e --- /dev/null +++ b/src/ranking/ranking.module.ts @@ -0,0 +1,18 @@ +import { Module } from "@nestjs/common"; +import { TypeOrmModule } from "@nestjs/typeorm"; +import { User } from "src/user/entities/user.entity"; +import { RankingController } from "./ranking.controller"; +import { JwtService } from "@nestjs/jwt"; +import { AuthService } from "src/auth/auth.service"; +import { RankingService } from "./ranking.service"; +import { UserService } from "src/user/user.service"; + +@Module({ + imports: [ + TypeOrmModule.forFeature([User]), + ], + controllers: [RankingController], + providers: [JwtService, AuthService, RankingService, UserService] +}) + +export class RankingModule {} \ No newline at end of file diff --git a/src/user/entities/user.entity.ts b/src/user/entities/user.entity.ts index 50be3d1..f88dbf4 100644 --- a/src/user/entities/user.entity.ts +++ b/src/user/entities/user.entity.ts @@ -15,6 +15,10 @@ export class User { @Column({ unique: true }) email: string; + @Exclude() + @Column({ nullable: false, generated: "increment" }) + id: number; + @Exclude() @Column({ nullable: false }) hashPassword: string;