From 30d59f979c64bbb4025b6734a58e061516fcaa44 Mon Sep 17 00:00:00 2001 From: phgkfux43 <3469266505@qq.com> Date: Sat, 26 Apr 2025 22:40:15 +0800 Subject: [PATCH] ADD file via upload --- results1.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 results1.js diff --git a/results1.js b/results1.js new file mode 100644 index 0000000..59e3694 --- /dev/null +++ b/results1.js @@ -0,0 +1,12 @@ +const express = require('express'); +const router = express.Router(); +const resultController = require('../controllers/results'); +const { protect, authorize } = require('../middlewares/auth'); + +router.post('/', protect, resultController.submitResult); +router.get('/my-results', protect, resultController.getUserResults); + +// 以下路由需要教师或管理员权限 +router.get('/exam/:id', protect, authorize('teacher', 'admin'), resultController.getExamResults); + +module.exports = router; \ No newline at end of file