-
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
8e36faf
commit a8e6305
Showing
15 changed files
with
612 additions
and
352 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
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 |
---|---|---|
@@ -1,25 +1,16 @@ | ||
import { Controller, Get } from "@nestjs/common"; | ||
import { Validate } from "nestjs-typebox"; | ||
|
||
import { baseResponse, BaseResponse, UUIDType } from "src/common"; | ||
import { BaseResponse, UUIDType } from "src/common"; | ||
import { CurrentUser } from "src/common/decorators/user.decorator"; | ||
|
||
import { CurrentUser } from "../../common/decorators/user.decorator"; | ||
import { UserStatsSchema } from "../schemas/userStats.schema"; | ||
import { StatisticsService } from "../statistics.service"; | ||
|
||
import type { UserStats } from "../schemas/userStats.schema"; | ||
|
||
@Controller("statistics") | ||
export class StatisticsController { | ||
constructor(private statisticsService: StatisticsService) {} | ||
|
||
@Get() | ||
@Validate({ | ||
response: baseResponse(UserStatsSchema), | ||
}) | ||
async getUserStatistics( | ||
@CurrentUser("userId") currentUserId: UUIDType, | ||
): Promise<BaseResponse<UserStats>> { | ||
async getUserStatistics(@CurrentUser("userId") currentUserId: UUIDType) { | ||
return new BaseResponse(await this.statisticsService.getUserStats(currentUserId)); | ||
} | ||
} |
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
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
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
Oops, something went wrong.