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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user