service.js
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
angular.module('focaEstadoCisternas')
.factory('focaEstadoCisternasService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) {
return {
getVehiculos: function() {
return $http.get(API_ENDPOINT.URL + '/vehiculo');
},
getTransportistas: function() {
return $http.get(API_ENDPOINT.URL + '/transportista');
},
getCisternadoPorVehiculo: function(idVehiculo) {
return $http.get(API_ENDPOINT.URL + '/cisterna/listar/' + idVehiculo);
},
getCisterna: function(id) {
return $http.get(API_ENDPOINT.URL + '/cisterna/obtener/' + id);
},
guardarCisterna: function(cisterna) {
return $http.post(API_ENDPOINT.URL + '/cisterna/guardar', {cisterna: cisterna});
},
deleteCisterna: function(id) {
return $http.delete(API_ENDPOINT.URL + '/cisterna/borrar/' + id);
},
getVehiculosPorTransportista: function(id) {
return $http.get(API_ENDPOINT.URL + '/vehiculo/transportista/' + id);
},
getEstadoCisterna: function(id, fecha) {
return $http.post(API_ENDPOINT.URL + '/cisterna/stock',
{idCisterna: id, fecha: fecha});
},
getBotonera: function() {
return [
{
label: 'Vehiculo',
image: 'vehiculos.png'
},
{
label: 'Fecha entrega',
image: 'fechaDeReparto.png'
},
{
label: 'Grafico',
image: 'fechaDeReparto.png'
}
];
}
};
}]);