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:
43
src/composants/composants.controller.ts
Normal file
43
src/composants/composants.controller.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { ComposantsService } from './composants.service';
|
||||
import { CreateComposantDto, UpdateComposantDto } from '../shared/dto/composant.dto';
|
||||
|
||||
@Controller('composants')
|
||||
export class ComposantsController {
|
||||
constructor(private readonly composantsService: ComposantsService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createComposantDto: CreateComposantDto) {
|
||||
return this.composantsService.create(createComposantDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.composantsService.findAll();
|
||||
}
|
||||
|
||||
@Get('hierarchy/:machineId')
|
||||
findHierarchy(@Param('machineId') machineId: string) {
|
||||
return this.composantsService.findHierarchy(machineId);
|
||||
}
|
||||
|
||||
@Get('machine/:machineId')
|
||||
findByMachine(@Param('machineId') machineId: string) {
|
||||
return this.composantsService.findByMachine(machineId);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.composantsService.findOne(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateComposantDto: UpdateComposantDto) {
|
||||
return this.composantsService.update(id, updateComposantDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.composantsService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user