nueva db
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const route = '/grupo';
|
||||
const controllerPath = '../controller/Grupo';
|
||||
const route = '/tercer_semestre';
|
||||
const controllerPath = '../controller/TercerSemestre';
|
||||
const get = require(`${controllerPath}/get`);
|
||||
|
||||
// GET
|
||||
app.get(`${route}`, (req, res) => {
|
||||
return get(req.query)
|
||||
.then((data) => {
|
||||
@@ -0,0 +1,29 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const route = '/grupo_horario';
|
||||
const controllerPath = '../controller/GrupoHorario';
|
||||
// const horariosDia = require(`${controllerPath}/horariosDia`);
|
||||
// const monitor = require(`${controllerPath}/monitor`);
|
||||
|
||||
// // GET
|
||||
// app.get(`${route}/horarios_dia`, (req, res) => {
|
||||
// return horariosDia(req.body)
|
||||
// .then((data) => {
|
||||
// res.status(200).json(data);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// res.status(400).json({ message: err.message });
|
||||
// });
|
||||
// });
|
||||
|
||||
// app.get(`${route}/monitor`, (req, res) => {
|
||||
// return monitor(req.body)
|
||||
// .then((data) => {
|
||||
// res.status(200).json(data);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// res.status(400).json({ message: err.message });
|
||||
// });
|
||||
// });
|
||||
|
||||
module.exports = app;
|
||||
@@ -1,17 +0,0 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const route = '/carrera';
|
||||
const controllerPath = '../controller/Carrera';
|
||||
const get = require(`${controllerPath}/get`);
|
||||
|
||||
app.get(`${route}`, (req, res) => {
|
||||
return get()
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -1,40 +0,0 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const route = '/carrera_horario';
|
||||
const controllerPath = '../controller/CarreraHorario';
|
||||
const get = require(`${controllerPath}/get`);
|
||||
const horariosDia = require(`${controllerPath}/horariosDia`);
|
||||
const monitor = require(`${controllerPath}/monitor`);
|
||||
|
||||
// GET
|
||||
app.get(`${route}`, (req, res) => {
|
||||
return get(req.query)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.get(`${route}/horarios_dia`, (req, res) => {
|
||||
return horariosDia(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.get(`${route}/monitor`, (req, res) => {
|
||||
return monitor(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -1,29 +0,0 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const route = '/grupo_horario';
|
||||
const controllerPath = '../controller/GrupoHorario';
|
||||
const horariosDia = require(`${controllerPath}/horariosDia`);
|
||||
const monitor = require(`${controllerPath}/monitor`);
|
||||
|
||||
// GET
|
||||
app.get(`${route}/horarios_dia`, (req, res) => {
|
||||
return horariosDia(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.get(`${route}/monitor`, (req, res) => {
|
||||
return monitor(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -1,64 +0,0 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const route = '/primer_semestre';
|
||||
const controllerPath = '../controller/PrimerSemestre';
|
||||
const alumnosCarrera = require(`${controllerPath}/alumnosCarrera`);
|
||||
const asistencia = require(`${controllerPath}/asistencia`);
|
||||
const asistentes = require(`${controllerPath}/asistentes`);
|
||||
const csv = require(`${controllerPath}/csv`);
|
||||
const registrar = require(`${controllerPath}/registrar`);
|
||||
|
||||
// POST
|
||||
app.post(`${route}/csv`, (req, res) => {
|
||||
return csv(req.body)
|
||||
.then((data) => {
|
||||
res.download(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.post(`${route}/registrar`, (req, res) => {
|
||||
return registrar(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
// PUT
|
||||
app.put(`${route}/asistencia`, (req, res) => {
|
||||
return asistencia(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
// GET
|
||||
app.get(`${route}/asistentes`, (req, res) => {
|
||||
return asistentes(req.query)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.get(`${route}/alumnos_carrera`, (req, res) => {
|
||||
return alumnosCarrera(req.query)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -1,75 +0,0 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const route = '/tercer_semestre';
|
||||
const controllerPath = '../controller/TercerSemestre';
|
||||
const alumnosCarrera = require(`${controllerPath}/alumnosCarrera`);
|
||||
const asistencia = require(`${controllerPath}/asistencia`);
|
||||
const asistentes = require(`${controllerPath}/asistentes`);
|
||||
const csv = require(`${controllerPath}/csv`);
|
||||
const get = require(`${controllerPath}/get`);
|
||||
const registrar = require(`${controllerPath}/registrar`);
|
||||
|
||||
// POST
|
||||
app.post(`${route}/csv`, (req, res) => {
|
||||
return csv(req.body)
|
||||
.then((data) => {
|
||||
res.download(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
//PUT
|
||||
app.put(`${route}/registrar`, (req, res) => {
|
||||
return registrar(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.put(`${route}/asistencia`, (req, res) => {
|
||||
return asistencia(req.body)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
// GET
|
||||
app.get(`${route}`, (req, res) => {
|
||||
return get(req.query)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.get(`${route}/asistentes`, (req, res) => {
|
||||
return asistentes(req.query)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
app.get(`${route}/alumnos_carrera`, (req, res) => {
|
||||
return alumnosCarrera(req.query)
|
||||
.then((data) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).json({ message: err.message });
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -1,11 +1,7 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
|
||||
app.use(require('./Carrera'));
|
||||
app.use(require('./CarreraHorario'));
|
||||
app.use(require('./Grupo'));
|
||||
app.use(require('./GrupoHorario'));
|
||||
app.use(require('./PrimerSemestre'));
|
||||
app.use(require('./TercerSemestre'));
|
||||
app.use(require('./Alumno'));
|
||||
app.use(require('./AlumnoHorario'));
|
||||
|
||||
module.exports = app;
|
||||
|
||||
Reference in New Issue
Block a user