2025-09-17 16:35:52 -06:00
|
|
|
import { Controller, Get, Post, Body, Param } from '@nestjs/common';
|
|
|
|
|
import { AlumnoService } from './student.service';
|
2025-09-09 21:19:17 -04:00
|
|
|
import { CreateStudentDto } from './dto/create-student.dto';
|
2025-09-18 16:50:10 -06:00
|
|
|
import { Alumno } from './entities/student.entity';
|
2025-09-09 21:19:17 -04:00
|
|
|
|
|
|
|
|
@Controller('student')
|
2025-09-18 21:08:19 -06:00
|
|
|
export class AlumnoController {
|
2025-09-17 16:35:52 -06:00
|
|
|
constructor(private readonly alumnoService: AlumnoService) {}
|
2025-09-09 21:19:17 -04:00
|
|
|
|
|
|
|
|
@Post()
|
2025-09-18 16:50:10 -06:00
|
|
|
async create(@Body() createStudentDto: CreateStudentDto): Promise<Alumno> {
|
2025-09-17 16:35:52 -06:00
|
|
|
return this.alumnoService.create(createStudentDto);
|
2025-09-09 21:19:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get(':id')
|
2025-09-16 22:37:25 -06:00
|
|
|
findOne(@Param('id') id: number) {
|
2025-09-17 16:35:52 -06:00
|
|
|
return this.alumnoService.findOne(+id);
|
2025-09-09 21:19:17 -04:00
|
|
|
}
|
2025-09-24 11:04:08 -04:00
|
|
|
|
|
|
|
|
@Post('/create')
|
|
|
|
|
async newStudent(@Body() createStudentDto: CreateStudentDto) {
|
|
|
|
|
return this.alumnoService.create(createStudentDto);
|
|
|
|
|
}
|
2025-09-09 21:19:17 -04:00
|
|
|
}
|
2025-09-24 11:00:56 -06:00
|
|
|
//IO
|