aaee_ra3_proy4_node-express/services/ContinenteService.js
Isidoro Nevares Martín 38f5722896 Commit inicial
2026-03-13 13:08:48 +01:00

24 lines
636 B
JavaScript

const ContinenteDAOImpl = require('../dao/impl/ContinenteDAOImpl');
class ContinenteService {
constructor() {
this.dao = new ContinenteDAOImpl(); // instancia del DAO
}
// Obtener todos los continentes
async obtenerListaContinentes() {
return await this.dao.listarTodos();
}
// Obtener continente por código
async obtenerContinentePorCodigo(codigo) {
return await this.dao.buscarPorCodigo(codigo);
}
// Obtener continente por nombre (puede devolver varios)
async obtenerContinentePorNombre(nombre) {
return await this.dao.buscarPorNombre(nombre);
}
}
module.exports = new ContinenteService();