Atualização repositorio
This commit is contained in:
51
src/logistic/logistic.controller.ts
Normal file
51
src/logistic/logistic.controller.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
/*
|
||||
https://docs.nestjs.com/controllers#controllers
|
||||
*/
|
||||
|
||||
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
|
||||
import { LogisticService } from './logistic.service';
|
||||
import { CarOutDelivery } from 'src/core/models/car-out-delivery.model';
|
||||
import { CarInDelivery } from 'src/core/models/car-in-delivery.model';
|
||||
|
||||
@Controller('api/v1/logistic')
|
||||
export class LogisticController {
|
||||
|
||||
constructor( private readonly logisticService: LogisticService) {}
|
||||
|
||||
@Get('expedicao')
|
||||
getExpedicao() {
|
||||
try {
|
||||
return this.logisticService.getExpedicao();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
@Get('employee')
|
||||
getEmployee() {
|
||||
return this.logisticService.getEmployee();
|
||||
}
|
||||
|
||||
@Get('deliveries/:placa')
|
||||
getDelivery(@Param('placa') placa: string) {
|
||||
return this.logisticService.getDeliveries(placa);
|
||||
}
|
||||
|
||||
@Get('status-car/:placa')
|
||||
getStatusCar(@Param('placa') placa: string) {
|
||||
return this.logisticService.getStatusCar(placa);
|
||||
}
|
||||
|
||||
@Post('create')
|
||||
createOutCar(@Body() data: CarOutDelivery) {
|
||||
return this.logisticService.createCarOut(data);
|
||||
}
|
||||
|
||||
@Post('return-car')
|
||||
createinCar(@Body() data: CarInDelivery) {
|
||||
return this.logisticService.createCarIn(data);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user