-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
135c2a7
commit 5b1dd5c
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |