added guard jwt
This commit is contained in:
@@ -11,11 +11,13 @@ import { Role } from 'src/role.enum';
|
||||
export class AlumnoController {
|
||||
constructor(private readonly alumnoService: AlumnoService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
async find() {
|
||||
return this.alumnoService.findAll()
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
async create(@Body() createStudentDto: CreateStudentDto): Promise<Alumno> {
|
||||
return this.alumnoService.create(createStudentDto);
|
||||
@@ -33,6 +35,7 @@ export class AlumnoController {
|
||||
return this.alumnoService.findOne(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('/create')
|
||||
async newStudent(@Body() createStudentDto: CreateStudentDto) {
|
||||
return this.alumnoService.create(createStudentDto);
|
||||
|
||||
@@ -1,44 +1,40 @@
|
||||
import { Controller, Get, Post, Body, Param, Patch } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Body, Param, Patch, UseGuards } from '@nestjs/common';
|
||||
import { AlumnoInscritoService } from './alumno_inscrito.service';
|
||||
import {
|
||||
CreateAlumnoInscritoDto,
|
||||
} from './dto/create-alumno_inscrito.dto';
|
||||
import { AlumnoInscrito } from './entities/alumno_inscrito.entity';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('alumno-inscrito')
|
||||
export class AlumnoInscritoController {
|
||||
constructor(private readonly alumnoInscritoService: AlumnoInscritoService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
async create(@Body() dto: CreateAlumnoInscritoDto): Promise<AlumnoInscrito> {
|
||||
return this.alumnoInscritoService.createWhitoutPay(dto);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
async findAll(): Promise<AlumnoInscrito[]> {
|
||||
return this.alumnoInscritoService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get("/inscritos/:idPeriodo")
|
||||
async findAllInscritos(@Param('idPeriodo') idPeriodo: number) {
|
||||
return this.alumnoInscritoService.findAllInscritos(idPeriodo);
|
||||
}
|
||||
|
||||
// @Post('/tiempo')
|
||||
// async addTime(@Body() body: AddTimeDto) {
|
||||
// const { idCuenta, idPlataforma, tiempoExtra } = body;
|
||||
// return this.alumnoInscritoService.(
|
||||
// idCuenta,
|
||||
// idPlataforma,
|
||||
// tiempoExtra,
|
||||
// );
|
||||
// }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/plataforma')
|
||||
async findAllPlataforma() {
|
||||
return this.alumnoInscritoService.findAllPlataforma();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id_cuenta')
|
||||
async findByIdWhitoud(
|
||||
@Param('id_cuenta') id_cuenta: number,
|
||||
@@ -46,24 +42,11 @@ export class AlumnoInscritoController {
|
||||
return this.alumnoInscritoService.findByIdWhitoud(id_cuenta);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id_cuenta/sancion')
|
||||
async findById(
|
||||
@Param('id_cuenta') id_cuenta: number,
|
||||
): Promise<AlumnoInscrito[]> {
|
||||
return this.alumnoInscritoService.findById(id_cuenta);
|
||||
}
|
||||
|
||||
//pruebas borrar
|
||||
@Patch('platica/:idCuenta/:idPeriodo/:idPlataforma')
|
||||
marcarPlatica(
|
||||
@Param('idCuenta') idCuenta: number,
|
||||
@Param('idPeriodo') idPeriodo: number,
|
||||
@Param('idPlataforma') idPlataforma: number,
|
||||
) {
|
||||
return this.alumnoInscritoService.marcarPlatica(
|
||||
idCuenta,
|
||||
idPeriodo,
|
||||
idPlataforma,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Delete, Get, Param, Post, UseGuards } from '@nestjs/common';
|
||||
import { AlumnoSancionService } from './alumno_sancion.service';
|
||||
import { CreateAlumnoSancionDto } from './dto/create-alumno_sancion.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('alumno-sancion')
|
||||
export class AlumnoSancionController {
|
||||
constructor(private readonly alumnoSancionService: AlumnoSancionService) {}
|
||||
constructor(private readonly alumnoSancionService: AlumnoSancionService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
async create(@Body() createAlumnoSancionDto: CreateAlumnoSancionDto) {
|
||||
return this.alumnoSancionService.create(createAlumnoSancionDto);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findbyStudent(@Param('id') id: number) {
|
||||
return this.alumnoSancionService.findbyStudent(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Delete(':id_cuenta')
|
||||
async deleteSancionesAlumno(@Param('id_cuenta') id_cuenta: number) {
|
||||
return this.alumnoSancionService.removeByStudent(+id_cuenta);
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
||||
import { AreaUbicacionService } from './area_ubicacion.service';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('area-ubicacion')
|
||||
export class AreaUbicacionController {
|
||||
constructor(private readonly areaUbicacionService: AreaUbicacionService) {}
|
||||
constructor(private readonly areaUbicacionService: AreaUbicacionService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.areaUbicacionService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.areaUbicacionService.findOne(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/programs/:id')
|
||||
findProgramsByArea(@Param('id')id:number){
|
||||
findProgramsByArea(@Param('id') id: number) {
|
||||
return this.areaUbicacionService.findProgramsByArea(+id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,31 @@
|
||||
import { Controller, Get, Post, Body, Param, Patch } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Body, Param, Patch, UseGuards } from '@nestjs/common';
|
||||
import { BitacoraService } from './bitacora.service';
|
||||
import { BitacoraAlumnoDto, CreateBitacoraDto, EquiposPorEquipoDto } from './dto/create-bitacora.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('bitacora')
|
||||
export class BitacoraController {
|
||||
constructor(private readonly bitacoraService: BitacoraService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
assignment(@Body() createBitacoraDto: CreateBitacoraDto) {
|
||||
return this.bitacoraService.assignment(createBitacoraDto);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/cuenta/:id')
|
||||
findOneByAcount(@Param('id') id: string) {
|
||||
return this.bitacoraService.findOneByAcount(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/equipo/:id')
|
||||
findOneByMachine(@Param('id') id: string) {
|
||||
return this.bitacoraService.findOneByMachine(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch('cancelar/:id')
|
||||
cancelationByMachine(
|
||||
@Param('id') id: number,
|
||||
@@ -29,12 +34,13 @@ export class BitacoraController {
|
||||
return this.bitacoraService.cancelation(id, tiempo_asignado);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.bitacoraService.findAll();
|
||||
}
|
||||
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('equipos-por-dia')
|
||||
async obtenerEquipos(
|
||||
@Body() dto: BitacoraAlumnoDto
|
||||
@@ -45,6 +51,7 @@ export class BitacoraController {
|
||||
);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('equipos-por-equipo')
|
||||
async equiposPorEquipo(
|
||||
@Body() dto: EquiposPorEquipoDto,
|
||||
|
||||
@@ -5,45 +5,53 @@ import {
|
||||
Body,
|
||||
Patch,
|
||||
Param,
|
||||
Delete,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { BitacoraMesaService } from './bitacora_mesa.service';
|
||||
import { CreateBitacoraMesaDto, FindByDate } from './dto/create-bitacora_mesa.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('bitacora-mesa')
|
||||
export class BitacoraMesaController {
|
||||
constructor(private readonly bitacoraMesaService: BitacoraMesaService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
assignment(@Body() createBitacoraMesaDto: CreateBitacoraMesaDto) {
|
||||
return this.bitacoraMesaService.assignment(createBitacoraMesaDto);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.bitacoraMesaService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.bitacoraMesaService.findOne(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/cuenta/:id_cuenta')
|
||||
findByCuenta(@Param('id_cuenta') id_cuenta: string) {
|
||||
return this.bitacoraMesaService.findByCuenta(+id_cuenta);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/table/:id_mesa')
|
||||
findByTable(@Param('id_mesa') id_mesa: number) {
|
||||
return this.bitacoraMesaService.findByTable(id_mesa);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('/date')
|
||||
findByDate(@Body() data: FindByDate) {
|
||||
return this.bitacoraMesaService.findByDate(data.date);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch('cancelar/:id')
|
||||
cancelationByMachine(
|
||||
@Param('id') id: number,
|
||||
@@ -52,6 +60,7 @@ export class BitacoraMesaController {
|
||||
return this.bitacoraMesaService.cancelation(id, tiempo_asignado);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('mesas-por-dia')
|
||||
mesasPorDia(@Body() body: { fecha: string }) {
|
||||
return this.bitacoraMesaService.mesasPorFecha(body.fecha);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { CarreraService } from './carrera.service';
|
||||
import { Carrera } from './entities/carrera.entity';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('carrera')
|
||||
export class CarreraController {
|
||||
constructor(private readonly carreraService: CarreraService) {}
|
||||
constructor(private readonly carreraService: CarreraService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll(): Promise<Carrera[]> {
|
||||
return this.carreraService.findAll();
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
|
||||
import { CostoService } from './costo.service';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('costo')
|
||||
export class CostoController {
|
||||
constructor(private readonly costoService: CostoService) {}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.costoService.findAll();
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import { Body, Controller, Get, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
|
||||
import { DetalleServicioService } from './detalle_servicio.service';
|
||||
import { FindReciboByRangeDto } from 'src/recibo/dto/create-recibo.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
|
||||
@Controller('detalle-servicio')
|
||||
export class DetalleServicioController {
|
||||
constructor(private readonly detalleServicioService: DetalleServicioService) {}
|
||||
constructor(private readonly detalleServicioService: DetalleServicioService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll(){
|
||||
findAll() {
|
||||
return this.detalleServicioService.findAll()
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('rango')
|
||||
async findByDateRange(@Body() data: FindReciboByRangeDto) {
|
||||
return this.detalleServicioService.findByDateRange(data.desde, data.hasta);
|
||||
|
||||
@@ -1,57 +1,68 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Param, Patch, Post, UseGuards } from '@nestjs/common';
|
||||
import { EquipoService } from './equipo.service';
|
||||
import { Equipo } from './entities/equipo.entity';
|
||||
import { CreateEquipoDto, UpdateAreaEquiposDto } from './dto/create-equipo.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('equipo')
|
||||
export class EquipoController {
|
||||
constructor(private readonly equipoService: EquipoService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll(): Promise<Equipo[]> {
|
||||
return this.equipoService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/active')
|
||||
findActive() {
|
||||
return this.equipoService.findActive();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/disable')
|
||||
findDisable() {
|
||||
return this.equipoService.findDisable();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/student/:id')
|
||||
findOnlyUsable(@Param('id') id: number): Promise<Equipo[]> {
|
||||
return this.equipoService.findOnlyUsable(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/busy')
|
||||
findOnlyBusy(): Promise<Equipo[]> {
|
||||
return this.equipoService.findOnlyBusy();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string): Promise<Equipo> {
|
||||
return this.equipoService.findOne(id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
create(@Body() equipo: CreateEquipoDto) {
|
||||
return this.equipoService.create(equipo);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch()
|
||||
update(@Body() equipo: CreateEquipoDto) {
|
||||
return this.equipoService.update(equipo);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch(':id/activo')
|
||||
toggleActivo(@Param('id') id: number) {
|
||||
return this.equipoService.toggleActivo(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch('actualizar-area')
|
||||
actualizarPorArea(
|
||||
@Body() updateAreaEquiposDto: UpdateAreaEquiposDto,
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
||||
import { MensajeService } from './mensaje.service';
|
||||
import { CreateMensajeDto } from './dto/create-mensaje.dto';
|
||||
import { UpdateMensajeDto } from './dto/update-mensaje.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('mensaje')
|
||||
export class MensajeController {
|
||||
constructor(private readonly mensajeService: MensajeService) {}
|
||||
constructor(private readonly mensajeService: MensajeService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.mensajeService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.mensajeService.findOne(+id);
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
import { Controller, Body, Patch, Param, Get } from '@nestjs/common';
|
||||
import { Controller, Body, Patch, Param, Get, UseGuards } from '@nestjs/common';
|
||||
import { MesaService } from './mesa.service';
|
||||
import { UpdateMesaDto } from './dto/update-mesa.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('mesa')
|
||||
export class MesaController {
|
||||
constructor(private readonly mesaService: MesaService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
async findAll() {
|
||||
return this.mesaService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('activo')
|
||||
async findAllActivo() {
|
||||
return this.mesaService.findAllActivo();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch(':id')
|
||||
async updateActivo(
|
||||
@Param('id') id: number,
|
||||
@@ -24,6 +28,7 @@ export class MesaController {
|
||||
return this.mesaService.updateActivo(id, updateMesaDto);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch(':id/activo')
|
||||
toggleActivo(@Param('id') id: number) {
|
||||
return this.mesaService.toggleActivo(+id);
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { PeriodoService } from './periodo.service';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('periodo')
|
||||
export class PeriodoController {
|
||||
constructor(private readonly periodoService:PeriodoService){}
|
||||
constructor(private readonly periodoService: PeriodoService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll(){
|
||||
findAll() {
|
||||
return this.periodoService.findAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +1,37 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
|
||||
import { ProgramaService } from './programa.service';
|
||||
import { UpdateProgramaDto } from './dto/update-programa.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('programa')
|
||||
export class ProgramaController {
|
||||
constructor(private readonly programaService: ProgramaService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.programaService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.programaService.findOne(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
create(@Body() body) {
|
||||
return this.programaService.create(body);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateProgramaDto: UpdateProgramaDto) {
|
||||
return this.programaService.update(+id, updateProgramaDto);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Delete(':id')
|
||||
delete(@Param('id') id:string){
|
||||
return this.programaService.delete(+id);
|
||||
|
||||
@@ -1,26 +1,31 @@
|
||||
import { Controller, Get, Body, Patch, Param } from '@nestjs/common';
|
||||
import { Controller, Get, Body, Patch, Param, UseGuards } from '@nestjs/common';
|
||||
import { ProgramaEquipoService } from './programa_equipo.service';
|
||||
import { UpdateProgramaEquipoDto, UpdateProgramasSalaDto } from './dto/update-programa_equipo.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('programa-equipo')
|
||||
export class ProgramaEquipoController {
|
||||
constructor(private readonly programaEquipoService: ProgramaEquipoService) {}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('programas/:id')
|
||||
findAllProgramByNumber(@Param('id') id: number) {
|
||||
return this.programaEquipoService.findAllProgramByNumber(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('ubicacion/:id')
|
||||
findAllProgramByUbicacion(@Param('id') id: string) {
|
||||
return this.programaEquipoService.findAllProgramByUbication(id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.programaEquipoService.findOne(id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch('equipo/:id')
|
||||
updateMachine(
|
||||
@Param('id') id: string,
|
||||
@@ -32,6 +37,7 @@ export class ProgramaEquipoController {
|
||||
);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch('sala')
|
||||
updateBySala(@Body() dto: UpdateProgramasSalaDto) {
|
||||
return this.programaEquipoService.updateBySala(dto.sala, dto.programas);
|
||||
|
||||
@@ -7,11 +7,13 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { ReciboService } from './recibo.service';
|
||||
import { FindReciboByRangeDto } from './dto/create-recibo.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('recibo')
|
||||
export class ReciboController {
|
||||
constructor(private readonly reciboService: ReciboService) {}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('rango')
|
||||
async findByDateRange(@Body() data: FindReciboByRangeDto) {
|
||||
return this.reciboService.findByDateRange(data.desde, data.hasta);
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
||||
import { SancionService } from './sancion.service';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
@Controller('sancion')
|
||||
export class SancionController {
|
||||
constructor(private readonly sancionService: SancionService) {}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
find() {
|
||||
return this.sancionService.find();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: number) {
|
||||
return this.sancionService.findOne(+id);
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { ServicioService } from './servicio.service';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('servicio')
|
||||
export class ServicioController {
|
||||
constructor(private readonly servicioService: ServicioService) {}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.servicioService.findAll();
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
Post,
|
||||
Body,
|
||||
UseGuards,
|
||||
Request,
|
||||
Res,
|
||||
Req,
|
||||
} from '@nestjs/common';
|
||||
@@ -17,16 +16,19 @@ import { JwtAuthGuard } from './jwt.guard';
|
||||
export class UserController {
|
||||
constructor(private readonly userService: UserService) {}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
async getAll() {
|
||||
return this.userService.getAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/perfil')
|
||||
async getAllPerfil() {
|
||||
return this.userService.getAllPerfil();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
async Login(@Body() data: Login, @Res() res: Response) {
|
||||
return this.userService.Login(data, res);
|
||||
@@ -38,6 +40,7 @@ export class UserController {
|
||||
return req.user.role;
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('/create')
|
||||
async createUser(@Body() data: CreateUserDto) {
|
||||
return this.userService.create(data);
|
||||
|
||||
Reference in New Issue
Block a user