se agregó endpoint de ejemplo

This commit is contained in:
2025-11-05 10:43:08 -06:00
parent 5861064c8d
commit 7e7ee75511
7 changed files with 975 additions and 88 deletions
+17
View File
@@ -8,12 +8,14 @@ import {
Get,
Query,
Post,
Res,
} from '@nestjs/common';
import { EquipoService } from './equipo.service';
import { UpdateEquipoDto } from './dto/update-equipo.dto';
import { AuthGuard } from '@nestjs/passport';
import { Equipo } from './entities/equipo.entity';
import { CreateEquipoDto } from './dto/create-equipo.dto';
import type { Response } from 'express';
@Controller('equipos')
export class EquipoController {
@@ -107,4 +109,19 @@ export class EquipoController {
) {
return this.equipoService.findAllProcesadorforTipoEquipos(idEquipo);
}
@Get('reporte')
async generarReporte(@Res() res: Response) {
try {
await this.equipoService.createEcxel(res);
} catch (error) {
console.error('Error al generar el Excel:', error);
res.status(500).send('Error al generar el archivo Excel');
}
}
@Post('example')
async generate() {
this.equipoService.example();
}
}