Creacion de entities
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { StudentService } from './student.service';
|
||||
import { CreateStudentDto } from './dto/create-student.dto';
|
||||
import { UpdateStudentDto } from './dto/update-student.dto';
|
||||
|
||||
@Controller('student')
|
||||
export class StudentController {
|
||||
constructor(private readonly studentService: StudentService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createStudentDto: CreateStudentDto) {
|
||||
return this.studentService.create(createStudentDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.studentService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.studentService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateStudentDto: UpdateStudentDto) {
|
||||
return this.studentService.update(+id, updateStudentDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.studentService.remove(+id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user