24 lines
636 B
JavaScript
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(); |