Merge branch 'dev' into docs/swagger-autogen

This commit is contained in:
Tibo De Peuter 2025-03-13 21:39:35 +01:00
commit 5986ca57bf
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
189 changed files with 6160 additions and 1581 deletions

View file

@ -1,8 +1,5 @@
import express from 'express';
import {
getAllLearningObjects,
getLearningObject,
} from '../controllers/learningObjects.js';
import { getAllLearningObjects, getAttachment, getLearningObject, getLearningObjectHTML } from '../controllers/learning-objects.js';
const router = express.Router();
@ -24,4 +21,16 @@ router.get('/', getAllLearningObjects);
// Example: http://localhost:3000/learningObject/un_ai7
router.get('/:hruid', getLearningObject);
// Parameter: hruid of learning object
// Query: language, version (optional)
// Route to fetch the HTML rendering of one learning object based on its hruid.
// Example: http://localhost:3000/learningObject/un_ai7/html
router.get('/:hruid/html', getLearningObjectHTML);
// Parameter: hruid of learning object, name of attachment.
// Query: language, version (optional).
// Route to get the raw data of the attachment for one learning object based on its hruid.
// Example: http://localhost:3000/learningObject/u_test/attachment/testimage.png
router.get('/:hruid/html/:attachmentName', getAttachment);
export default router;

View file

@ -1,5 +1,5 @@
import express from 'express';
import { getLearningPaths } from '../controllers/learningPaths.js';
import { getLearningPaths } from '../controllers/learning-paths.js';
const router = express.Router();

View file

@ -15,8 +15,7 @@ router.get('/:id', (req, res) => {
student: '0',
group: '0',
time: new Date(2025, 1, 1),
content:
'Zijn alle gehele getallen groter dan 2 gelijk aan de som van 2 priemgetallen????',
content: 'Zijn alle gehele getallen groter dan 2 gelijk aan de som van 2 priemgetallen????',
learningObject: '0',
links: {
self: `${req.baseUrl}/${req.params.id}`,

View file

@ -0,0 +1,35 @@
import { Response, Router } from 'express';
import studentRouter from './student';
import groupRouter from './group';
import assignmentRouter from './assignment';
import submissionRouter from './submission';
import classRouter from './class';
import questionRouter from './question';
import authRouter from './auth';
import themeRoutes from './themes';
import learningPathRoutes from './learning-paths';
import learningObjectRoutes from './learning-objects';
import { getLogger, Logger } from '../logging/initalize';
const router = Router();
const logger: Logger = getLogger();
router.get('/', (_, res: Response) => {
logger.debug('GET /');
res.json({
message: 'Hello Dwengo!🚀',
});
});
router.use('/student', studentRouter /* #swagger.tags = ['Student'] */);
router.use('/group', groupRouter /* #swagger.tags = ['Group'] */);
router.use('/assignment', assignmentRouter /* #swagger.tags = ['Assignment'] */);
router.use('/submission', submissionRouter /* #swagger.tags = ['Submission'] */);
router.use('/class', classRouter /* #swagger.tags = ['Class'] */);
router.use('/question', questionRouter /* #swagger.tags = ['Question'] */);
router.use('/auth', authRouter /* #swagger.tags = ['Auth'] */);
router.use('/theme', themeRoutes /* #swagger.tags = ['Theme'] */);
router.use('/learningPath', learningPathRoutes /* #swagger.tags = ['Learning Path'] */);
router.use('/learningObject', learningObjectRoutes /* #swagger.tags = ['Learning Object'] */);
export default router;