Skip to content

Commit

Permalink
feat: add ranking controller
Browse files Browse the repository at this point in the history
  • Loading branch information
freitagfelipe committed Nov 30, 2023
1 parent 135c2a7 commit 5b1dd5c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/ranking/ranking.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Controller, Get, Param, UseGuards } from "@nestjs/common";
import { ApiBearerAuth, ApiTags } from "@nestjs/swagger";
import { RankingService } from "./ranking.service";
import { AuthGuard } from "src/auth/auth.guard";

@ApiTags("ranking")
@ApiBearerAuth()
@Controller("ranking")
export class RankingController {
constructor(
private readonly rankingService: RankingService,
) {}

@Get()
@UseGuards(AuthGuard)
async findAll() {
return await this.rankingService.findAll();
}

@Get("/rank/:username")
@UseGuards(AuthGuard)
async getRank(
@Param("username") username: string,
) {
return await this.rankingService.getRank(username);
}
}

0 comments on commit 5b1dd5c

Please sign in to comment.