units,lesson as standalone

This commit is contained in:
2026-07-10 11:44:46 +08:00
parent 86fba50b95
commit e1ffdab190
46 changed files with 1463 additions and 197 deletions
+1
View File
@@ -14,6 +14,7 @@ router.get('/uuid/:uuid', ctrl.getCourseByUuid);
router.get('/unit/uuid/:uuid/lessons', ctrl.getLessonsByUnitUuid);
router.get('/unit/uuid/:uuid', ctrl.getUnitByUuid);
router.get('/lesson/uuid/:uuid', ctrl.getLessonByUuid);
router.get('/quiz/uuid/:uuid', ctrl.getQuizByUuid);
// Courses
router.get('/', ctrl.getCourses);
+2
View File
@@ -3,6 +3,7 @@
* Type of Program: Router
* Description: Standalone Lesson consumption — each Lesson runs independently.
*
* GET /client/lessons → learner-facing lesson library
* GET /client/lessons/:uuid → lesson with full block content
* POST /client/lessons/:uuid/progress → standalone reading progress
* (course NULL; body.unit_uuid optional)
@@ -14,6 +15,7 @@ const express = require('express');
const router = express.Router();
const ctrl = require('../../controllers/client/units.controller');
router.get('/', ctrl.getLessons);
router.get('/:uuid', ctrl.getLessonByUuid);
router.post('/:uuid/progress', ctrl.upsertStandaloneLessonProgress);
+2 -1
View File
@@ -16,10 +16,11 @@
***********************************************************************************************************************************************************************/
const express = require('express');
const router = express.Router();
const { list, unseenCount, markSeen, markAllSeen, clearAll } = require('../../controllers/client/notification.controller');
const { list, unseenCount, stickyAnnouncement, markSeen, markAllSeen, clearAll } = require('../../controllers/client/notification.controller');
router.get('/', list);
router.get('/unseen', unseenCount);
router.get('/sticky', stickyAnnouncement);
router.patch('/seen-all', markAllSeen);
router.patch('/:id/seen', markSeen);
router.delete('/clear-all', clearAll);