20 lines
664 B
TypeScript
20 lines
664 B
TypeScript
import { Controller, Get, UseGuards } from '@nestjs/common';
|
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
|
import { DashboardService } from './dashboard.service';
|
|
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
|
|
|
@ApiTags('dashboard')
|
|
@Controller('dashboard')
|
|
@UseGuards(JwtAuthGuard)
|
|
@ApiBearerAuth()
|
|
export class DashboardController {
|
|
constructor(private dashboardService: DashboardService) {}
|
|
|
|
@Get('stats')
|
|
@ApiOperation({ summary: 'Obter estatísticas do dashboard' })
|
|
@ApiResponse({ status: 200, description: 'Estatísticas retornadas' })
|
|
getStats() {
|
|
return this.dashboardService.getStats();
|
|
}
|
|
}
|