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/pieces/pieces.controller.ts
Normal file
43
src/pieces/pieces.controller.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { PiecesService } from './pieces.service';
|
||||
import { CreatePieceDto, UpdatePieceDto } from '../shared/dto/piece.dto';
|
||||
|
||||
@Controller('pieces')
|
||||
export class PiecesController {
|
||||
constructor(private readonly piecesService: PiecesService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createPieceDto: CreatePieceDto) {
|
||||
return this.piecesService.create(createPieceDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.piecesService.findAll();
|
||||
}
|
||||
|
||||
@Get('machine/:machineId')
|
||||
findByMachine(@Param('machineId') machineId: string) {
|
||||
return this.piecesService.findByMachine(machineId);
|
||||
}
|
||||
|
||||
@Get('composant/:composantId')
|
||||
findByComposant(@Param('composantId') composantId: string) {
|
||||
return this.piecesService.findByComposant(composantId);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.piecesService.findOne(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updatePieceDto: UpdatePieceDto) {
|
||||
return this.piecesService.update(id, updatePieceDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.piecesService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user