feat: Modules de gestion des entités principales - Ajout des modules Machines, Composants et Pièces avec leurs services et contrôleurs
This commit is contained in:
38
src/machines/machines.controller.ts
Normal file
38
src/machines/machines.controller.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { MachinesService } from './machines.service';
|
||||
import { CreateMachineDto, UpdateMachineDto } from '../shared/dto/machine.dto';
|
||||
|
||||
@Controller('machines')
|
||||
export class MachinesController {
|
||||
constructor(private readonly machinesService: MachinesService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createMachineDto: CreateMachineDto) {
|
||||
return this.machinesService.create(createMachineDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.machinesService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.machinesService.findOne(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateMachineDto: UpdateMachineDto) {
|
||||
return this.machinesService.update(id, updateMachineDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.machinesService.remove(id);
|
||||
}
|
||||
|
||||
@Post(':id/add-custom-fields')
|
||||
addMissingCustomFields(@Param('id') id: string) {
|
||||
return this.machinesService.addMissingCustomFields(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user