summaryrefslogtreecommitdiffstats
path: root/back
diff options
context:
space:
mode:
authorDayana31 <[email protected]>2022-05-25 00:46:47 -0500
committerDayana31 <[email protected]>2022-05-25 00:46:47 -0500
commit0a6262eed672dc25f9d0efefc836a370541b6020 (patch)
tree78adba3fbd30a71ed4295b3086194cf90e56555a /back
parent685e55b7db795579f69bb158276fbb4cec0a14e1 (diff)
downloadDP1_project-0a6262eed672dc25f9d0efefc836a370541b6020.tar.gz
DP1_project-0a6262eed672dc25f9d0efefc836a370541b6020.tar.bz2
DP1_project-0a6262eed672dc25f9d0efefc836a370541b6020.zip
Dao, Controller y Services
Diffstat (limited to 'back')
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java50
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java49
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java53
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java49
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java11
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java11
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java32
26 files changed, 1039 insertions, 0 deletions
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java
index ae107cf..f5555d6 100644
--- a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java
@@ -1,5 +1,55 @@
package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Averia;
+import pe.edu.pucp.odiparback.services.AveriaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/averia")
+@CrossOrigin
public class AveriaController {
+ @Autowired
+ AveriaService averiaService;
+
+ @GetMapping(value = "/")
+ List<Averia> getAll(){
+ return averiaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "averia",key = "#id")
+ Averia get(@PathVariable int id)throws AuthenticationException{
+ return averiaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Averia averia)throws SQLException{
+ averiaService.register(averia);
+ }
+
+ @PutMapping(value = "/")
+ Averia update(@RequestBody Averia averia)throws SQLException{
+ return averiaService.update(averia);
+ }
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "averia", allEntries = true)
+ void delete(@PathVariable int id){
+ averiaService.delete(id);
+ }
+
}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java
index e455438..59336b5 100644
--- a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java
@@ -1,5 +1,54 @@
package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Camion;
+import pe.edu.pucp.odiparback.services.CamionService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+@RestController
+@RequestMapping("/camion")
+@CrossOrigin
public class CamionController {
+ @Autowired
+ CamionService camionService;
+
+ @GetMapping(value = "/")
+ List<Camion> getAll(){
+ return camionService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "camion",key = "#id")
+ Camion get(@PathVariable int id)throws AuthenticationException{
+ return camionService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Camion camion)throws SQLException{
+ camionService.register(camion);
+ }
+
+ @PutMapping(value = "/")
+ Camion update(@RequestBody Camion camion)throws SQLException{
+ return camionService.update(camion);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "camion", allEntries = true)
+ void delete(@PathVariable int id){
+ camionService.delete(id);
+ }
}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java
new file mode 100644
index 0000000..c3e0b6d
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Cliente;
+import pe.edu.pucp.odiparback.services.ClienteService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/cliente")
+@CrossOrigin
+public class ClienteController {
+ @Autowired
+ ClienteService clienteService;
+
+ @GetMapping(value = "/")
+ List<Cliente> getAll(){
+ return clienteService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "cliente",key = "#id")
+ Cliente get(@PathVariable int id)throws AuthenticationException{
+ return clienteService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Cliente cliente)throws SQLException{
+ clienteService.register(cliente);
+ }
+
+ @PutMapping(value = "/")
+ Cliente update(@RequestBody Cliente cliente)throws SQLException{
+ return clienteService.update(cliente);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "cliente", allEntries = true)
+ void delete(@PathVariable int id){
+ clienteService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java
new file mode 100644
index 0000000..adba375
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java
@@ -0,0 +1,53 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.PTG;
+import pe.edu.pucp.odiparback.services.PTGService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/ptg")
+@CrossOrigin
+public class PTGController {
+ @Autowired
+ PTGService ptgService;
+
+ @GetMapping(value = "/")
+ List<PTG> getAll(){
+ return ptgService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "ptg",key = "#id")
+ PTG get(@PathVariable int id)throws AuthenticationException{
+ return ptgService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody PTG ptg)throws SQLException{
+ ptgService.register(ptg);
+ }
+
+ @PutMapping(value = "/")
+ PTG update(@RequestBody PTG ptg)throws SQLException{
+ return ptgService.update(ptg);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "ptg", allEntries = true)
+ void delete(@PathVariable int id){
+ ptgService.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java
index e875f78..a1a6c2e 100644
--- a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java
@@ -1,5 +1,54 @@
package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Pedido;
+import pe.edu.pucp.odiparback.services.PedidoService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+@RestController
+@RequestMapping("/pedido")
+@CrossOrigin
public class PedidoController {
+ @Autowired
+ PedidoService pedidoService;
+
+ @GetMapping(value = "/")
+ List<Pedido> getAll(){
+ return pedidoService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "pedido",key = "#id")
+ Pedido get(@PathVariable int id)throws AuthenticationException{
+ return pedidoService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Pedido pedido)throws SQLException{
+ pedidoService.register(pedido);
+ }
+
+ @PutMapping(value = "/")
+ Pedido update(@RequestBody Pedido pedido)throws SQLException{
+ return pedidoService.update(pedido);
+ }
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "pedido", allEntries = true)
+ void delete(@PathVariable int id){
+ pedidoService.delete(id);
+ }
+
}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java
new file mode 100644
index 0000000..a55e68d
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Region;
+import pe.edu.pucp.odiparback.services.RegionService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/region")
+@CrossOrigin
+public class RegionController {
+ @Autowired
+ RegionService regionService;
+
+ @GetMapping(value = "/")
+ List<Region> getAll(){
+ return regionService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "region",key = "#id")
+ Region get(@PathVariable int id)throws AuthenticationException{
+ return regionService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Region region)throws SQLException{
+ regionService.register(region);
+ }
+
+ @PutMapping(value = "/")
+ Region update(@RequestBody Region region)throws SQLException{
+ return regionService.update(region);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "region", allEntries = true)
+ void delete(@PathVariable int id){
+ regionService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java
new file mode 100644
index 0000000..096013a
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Ruta;
+import pe.edu.pucp.odiparback.services.RutaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/ruta")
+@CrossOrigin
+public class RutaController {
+ @Autowired
+ RutaService rutaService;
+
+ @GetMapping(value = "/")
+ List<Ruta> getAll(){
+ return rutaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "ruta",key = "#id")
+ Ruta get(@PathVariable int id)throws AuthenticationException{
+ return rutaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Ruta ruta)throws SQLException{
+ rutaService.register(ruta);
+ }
+
+ @PutMapping(value = "/")
+ Ruta update(@RequestBody Ruta ruta)throws SQLException{
+ return rutaService.update(ruta);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "ruta", allEntries = true)
+ void delete(@PathVariable int id){
+ rutaService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java
new file mode 100644
index 0000000..d66f813
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.TipoAveria;
+import pe.edu.pucp.odiparback.services.TipoAveriaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tipoAveria")
+@CrossOrigin
+public class TipoAveriaController {
+ @Autowired
+ TipoAveriaService tipoAveriaService;
+
+ @GetMapping(value = "/")
+ List<TipoAveria> getAll(){
+ return tipoAveriaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tipoAveria",key = "#id")
+ TipoAveria get(@PathVariable int id)throws AuthenticationException{
+ return tipoAveriaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody TipoAveria tipoAveria)throws SQLException{
+ tipoAveriaService.register(tipoAveria);
+ }
+
+ @PutMapping(value = "/")
+ TipoAveria update(@RequestBody TipoAveria tipoAveria)throws SQLException{
+ return tipoAveriaService.update(tipoAveria);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tipoAveria", allEntries = true)
+ void delete(@PathVariable int id){
+ tipoAveriaService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java
new file mode 100644
index 0000000..72beae9
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.TipoCamion;
+import pe.edu.pucp.odiparback.services.TipoCamionService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tipoCamion")
+@CrossOrigin
+public class TipoCamionController {
+ @Autowired
+ TipoCamionService tipoCamionService;
+
+ @GetMapping(value = "/")
+ List<TipoCamion> getAll(){
+ return tipoCamionService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tipoCamion",key = "#id")
+ TipoCamion get(@PathVariable int id)throws AuthenticationException{
+ return tipoCamionService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody TipoCamion tipoCamion)throws SQLException{
+ tipoCamionService.register(tipoCamion);
+ }
+
+ @PutMapping(value = "/")
+ TipoCamion update(@RequestBody TipoCamion tipoCamion)throws SQLException{
+ return tipoCamionService.update(tipoCamion);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tipoCamion", allEntries = true)
+ void delete(@PathVariable int id){
+ tipoCamionService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java
new file mode 100644
index 0000000..05606ad
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Tramo;
+import pe.edu.pucp.odiparback.services.TramoService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tramo")
+@CrossOrigin
+public class TramoController {
+ @Autowired
+ TramoService tramoService;
+
+ @GetMapping(value = "/")
+ List<Tramo> getAll(){
+ return tramoService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tramo",key = "#id")
+ Tramo get(@PathVariable int id)throws AuthenticationException{
+ return tramoService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Tramo tramo)throws SQLException{
+ tramoService.register(tramo);
+ }
+
+ @PutMapping(value = "/")
+ Tramo update(@RequestBody Tramo tramo)throws SQLException{
+ return tramoService.update(tramo);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tramo", allEntries = true)
+ void delete(@PathVariable int id){
+ tramoService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java
new file mode 100644
index 0000000..9c37098
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.TramoRuta;
+import pe.edu.pucp.odiparback.services.TramoRutaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tramoRuta")
+@CrossOrigin
+public class TramoRutaController {
+ @Autowired
+ TramoRutaService tramoRutaService;
+
+ @GetMapping(value = "/")
+ List<TramoRuta> getAll(){
+ return tramoRutaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tramo",key = "#id")
+ TramoRuta get(@PathVariable int id)throws AuthenticationException{
+ return tramoRutaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody TramoRuta tramoRuta)throws SQLException{
+ tramoRutaService.register(tramoRuta);
+ }
+
+ @PutMapping(value = "/")
+ TramoRuta update(@RequestBody TramoRuta tramoRuta)throws SQLException{
+ return tramoRutaService.update(tramoRuta);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tramoRuta", allEntries = true)
+ void delete(@PathVariable int id){
+ tramoRutaService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java
new file mode 100644
index 0000000..aaa9038
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Usuario;
+import pe.edu.pucp.odiparback.services.UsuarioService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/usuario")
+@CrossOrigin
+public class UsuarioController {
+ @Autowired
+ UsuarioService usuarioService;
+
+ @GetMapping(value = "/")
+ List<Usuario> getAll(){
+ return usuarioService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "usuario",key = "#id")
+ Usuario get(@PathVariable int id)throws AuthenticationException{
+ return usuarioService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Usuario usuario)throws SQLException{
+ usuarioService.register(usuario);
+ }
+
+ @PutMapping(value = "/")
+ Usuario update(@RequestBody Usuario usuario)throws SQLException{
+ return usuarioService.update(usuario);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "usuario", allEntries = true)
+ void delete(@PathVariable int id){
+ usuarioService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java
new file mode 100644
index 0000000..ca6f5b0
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java
@@ -0,0 +1,11 @@
+package pe.edu.pucp.odiparback.dao;
+import java.util.List;
+import pe.edu.pucp.odiparback.models.PTG;
+
+public interface PTGDao {
+ public List<PTG> getAll();
+ public PTG get(int id);
+ public void register(PTG planTransporte);
+ public PTG update(PTG planTransporte);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java
new file mode 100644
index 0000000..5186bc5
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java
@@ -0,0 +1,11 @@
+package pe.edu.pucp.odiparback.dao;
+import java.util.List;
+import pe.edu.pucp.odiparback.models.TramoRuta;
+
+public interface TramoRutaDao {
+ public List<TramoRuta> getAll();
+ public TramoRuta get(int id);
+ public void register(TramoRuta tramoRuta);
+ public TramoRuta update(TramoRuta tramoRuta);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java
new file mode 100644
index 0000000..656452e
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.AveriaDao;
+import pe.edu.pucp.odiparback.models.Averia;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AveriaService {
+ @Autowired
+ AveriaDao daoAveria;
+
+ public List<Averia> getAll(){
+ return daoAveria.getAll();
+ }
+
+ public Averia get(int id){
+ return daoAveria.get(id);
+ }
+
+ public void register(Averia averia){
+ daoAveria.register(averia);
+ }
+
+ public Averia update(Averia averia){
+ return daoAveria.update(averia);
+ }
+
+ public void delete(int id){
+ daoAveria.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java
new file mode 100644
index 0000000..eabf02f
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.CamionDao;
+import pe.edu.pucp.odiparback.models.Camion;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CamionService {
+ @Autowired
+ CamionDao daoCamion;
+
+ public List<Camion> getAll(){
+ return daoCamion.getAll();
+ }
+
+ public Camion get(int id){
+ return daoCamion.get(id);
+ }
+
+ public void register(Camion camion){
+ daoCamion.register(camion);
+ }
+
+ public Camion update(Camion camion){
+ return daoCamion.update(camion);
+ }
+
+ public void delete(int id){
+ daoCamion.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java
new file mode 100644
index 0000000..2e8eb1b
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.ClienteDao;
+import pe.edu.pucp.odiparback.models.Cliente;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ClienteService {
+ @Autowired
+ ClienteDao daoCliente;
+
+ public List<Cliente> getAll(){
+ return daoCliente.getAll();
+ }
+
+ public Cliente get(int id){
+ return daoCliente.get(id);
+ }
+
+ public void register(Cliente cliente){
+ daoCliente.register(cliente);
+ }
+
+ public Cliente update(Cliente cliente){
+ return daoCliente.update(cliente);
+ }
+
+ public void delete(int id){
+ daoCliente.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java
new file mode 100644
index 0000000..1c7bfd0
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.PTGDao;
+import pe.edu.pucp.odiparback.models.PTG;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class PTGService {
+ @Autowired
+ PTGDao daoPTG;
+
+ public List<PTG> getAll(){
+ return daoPTG.getAll();
+ }
+
+ public PTG get(int id){
+ return daoPTG.get(id);
+ }
+
+ public void register(PTG planTransporte){
+ daoPTG.register(planTransporte);
+ }
+
+ public PTG update(PTG planTransporte){
+ return daoPTG.update(planTransporte);
+ }
+
+ public void delete(int id){
+ daoPTG.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java
new file mode 100644
index 0000000..e0ca661
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.PedidoDao;
+import pe.edu.pucp.odiparback.models.Pedido;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class PedidoService {
+ @Autowired
+ PedidoDao daoPedido;
+
+ public List<Pedido> getAll(){
+ return daoPedido.getAll();
+ }
+
+ public Pedido get(int id){
+ return daoPedido.get(id);
+ }
+
+ public void register(Pedido pedido){
+ daoPedido.register(pedido);
+ }
+
+ public Pedido update(Pedido pedido){
+ return daoPedido.update(pedido);
+ }
+
+ public void delete(int id){
+ daoPedido.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java
new file mode 100644
index 0000000..3f0f226
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.RegionDao;
+import pe.edu.pucp.odiparback.models.Region;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class RegionService {
+ @Autowired
+ RegionDao daoRegion;
+
+ public List<Region> getAll(){
+ return daoRegion.getAll();
+ }
+
+ public Region get(int id){
+ return daoRegion.get(id);
+ }
+
+ public void register(Region region){
+ daoRegion.register(region);
+ }
+
+ public Region update(Region region){
+ return daoRegion.update(region);
+ }
+
+ public void delete(int id){
+ daoRegion.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java
new file mode 100644
index 0000000..0055ae8
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.RutaDao;
+import pe.edu.pucp.odiparback.models.Ruta;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class RutaService {
+ @Autowired
+ RutaDao daoRuta;
+
+ public List<Ruta> getAll(){
+ return daoRuta.getAll();
+ }
+
+ public Ruta get(int id){
+ return daoRuta.get(id);
+ }
+
+ public void register(Ruta ruta){
+ daoRuta.register(ruta);
+ }
+
+ public Ruta update(Ruta ruta){
+ return daoRuta.update(ruta);
+ }
+
+ public void delete(int id){
+ daoRuta.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java
new file mode 100644
index 0000000..6cb7719
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TipoAveriaDao;
+import pe.edu.pucp.odiparback.models.TipoAveria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TipoAveriaService {
+ @Autowired
+ TipoAveriaDao daoTipoAveria;
+
+ public List<TipoAveria> getAll(){
+ return daoTipoAveria.getAll();
+ }
+
+ public TipoAveria get(int id){
+ return daoTipoAveria.get(id);
+ }
+
+ public void register(TipoAveria tipoAveria){
+ daoTipoAveria.register(tipoAveria);
+ }
+
+ public TipoAveria update(TipoAveria tipoAveria){
+ return daoTipoAveria.update(tipoAveria);
+ }
+
+ public void delete(int id){
+ daoTipoAveria.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java
new file mode 100644
index 0000000..fd7b811
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TipoCamionDao;
+import pe.edu.pucp.odiparback.models.TipoCamion;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TipoCamionService {
+ @Autowired
+ TipoCamionDao daoTipoCamion;
+
+ public List<TipoCamion> getAll(){
+ return daoTipoCamion.getAll();
+ }
+
+ public TipoCamion get(int id){
+ return daoTipoCamion.get(id);
+ }
+
+ public void register(TipoCamion tipoCamion){
+ daoTipoCamion.register(tipoCamion);
+ }
+
+ public TipoCamion update(TipoCamion tipoCamion){
+ return daoTipoCamion.update(tipoCamion);
+ }
+
+ public void delete(int id){
+ daoTipoCamion.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java
new file mode 100644
index 0000000..2348992
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TramoRutaDao;
+import pe.edu.pucp.odiparback.models.TramoRuta;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TramoRutaService {
+ @Autowired
+ TramoRutaDao daoTramoRuta;
+
+ public List<TramoRuta> getAll(){
+ return daoTramoRuta.getAll();
+ }
+
+ public TramoRuta get(int id){
+ return daoTramoRuta.get(id);
+ }
+
+ public void register(TramoRuta tramoRuta){
+ daoTramoRuta.register(tramoRuta);
+ }
+
+ public TramoRuta update(TramoRuta tramoRuta){
+ return daoTramoRuta.update(tramoRuta);
+ }
+
+ public void delete(int id){
+ daoTramoRuta.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java
new file mode 100644
index 0000000..13fc5b2
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TramoDao;
+import pe.edu.pucp.odiparback.models.Tramo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TramoService {
+ @Autowired
+ TramoDao daoTramo;
+
+ public List<Tramo> getAll(){
+ return daoTramo.getAll();
+ }
+
+ public Tramo get(int id){
+ return daoTramo.get(id);
+ }
+
+ public void register(Tramo tramo){
+ daoTramo.register(tramo);
+ }
+
+ public Tramo update(Tramo tramo){
+ return daoTramo.update(tramo);
+ }
+
+ public void delete(int id){
+ daoTramo.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java
new file mode 100644
index 0000000..c7215ad
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.UsuarioDao;
+import pe.edu.pucp.odiparback.models.Usuario;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class UsuarioService {
+ @Autowired
+ UsuarioDao daoUsuario;
+
+ public List<Usuario> getAll(){
+ return daoUsuario.getAll();
+ }
+
+ public Usuario get(int id){
+ return daoUsuario.get(id);
+ }
+
+ public void register(Usuario usuario){
+ daoUsuario.register(usuario);
+ }
+
+ public Usuario update(Usuario usuario){
+ return daoUsuario.update(usuario);
+ }
+
+ public void delete(int id){
+ daoUsuario.delete(id);
+ }
+}