Creacion de entities y servicios

This commit is contained in:
2025-09-17 16:35:52 -06:00
parent 8cc039947f
commit 54306452ab
26 changed files with 460 additions and 39 deletions
+6 -12
View File
@@ -1,30 +1,24 @@
import {
Controller,
Get,
Post,
Body,
Param,
} from '@nestjs/common';
import { StudentService } from './student.service';
import { Controller, Get, Post, Body, Param } from '@nestjs/common';
import { AlumnoService } from './student.service';
import { CreateStudentDto } from './dto/create-student.dto';
import { Student } from './entities/student.entity';
@Controller('student')
export class StudentController {
constructor(private readonly studentService: StudentService) {}
constructor(private readonly alumnoService: AlumnoService) {}
@Post()
async create(@Body() createStudentDto: CreateStudentDto): Promise<Student> {
return this.studentService.create(createStudentDto);
return this.alumnoService.create(createStudentDto);
}
@Get()
async findAll(): Promise<Student[]> {
return this.studentService.findAll();
return this.alumnoService.findAll();
}
@Get(':id')
findOne(@Param('id') id: number) {
return this.studentService.findOne(+id);
return this.alumnoService.findOne(+id);
}
}