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;