feat(admin): implement admin statistics API and service

Add admin statistics endpoint to provide user, content, and category stats. Introduce `AdminModule` with controller, service, and repository integration for data aggregation. Include frontend service to consume the stats API.
This commit is contained in:
Mathis HERRIOT
2026-01-14 21:44:14 +01:00
parent 47d6fcb6a0
commit 6ce58d1639
4 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { Controller, Get, UseGuards } from "@nestjs/common";
import { AuthGuard } from "../auth/guards/auth.guard";
import { RolesGuard } from "../auth/guards/roles.guard";
import { Roles } from "../auth/decorators/roles.decorator";
import { AdminService } from "./admin.service";
@Controller("admin")
@UseGuards(AuthGuard, RolesGuard)
@Roles("admin")
export class AdminController {
constructor(private readonly adminService: AdminService) {}
@Get("stats")
getStats() {
return this.adminService.getStats();
}
}