feat: add logging and caching enhancements across core services

Integrate `Logger` for consistent logging in services like `reports`, `categories`, `users`, `contents`, and more. Introduce caching capabilities with `CacheInterceptor` and manual cache clearing logic for categories, users, and contents. Add request throttling to critical auth endpoints for enhanced rate limiting.
This commit is contained in:
Mathis HERRIOT
2026-01-10 16:31:06 +01:00
parent 9654553940
commit 5a22ad7480
12 changed files with 129 additions and 13 deletions

View File

@@ -11,7 +11,9 @@ import {
Query,
Req,
UseGuards,
UseInterceptors,
} from "@nestjs/common";
import { CacheInterceptor, CacheKey, CacheTTL } from "@nestjs/cache-manager";
import { AuthService } from "../auth/auth.service";
import { Roles } from "../auth/decorators/roles.decorator";
import { AuthGuard } from "../auth/guards/auth.guard";
@@ -41,6 +43,8 @@ export class UsersController {
// Listing public d'un profil
@Get("public/:username")
@UseInterceptors(CacheInterceptor)
@CacheTTL(60000) // 1 minute
findPublicProfile(@Param("username") username: string) {
return this.usersService.findPublicProfile(username);
}