const express = require('express');
const router = express.Router();
const deviceWarningController = require('../controllers/deviceWarningController');
// const authMiddleware = require('../middleware/auth'); // 假设有认证中间件

// router.use(authMiddleware); // 暂时注释掉认证中间件用于测试

// 设备预警管理路由
router.get('/', deviceWarningController.getDeviceWarnings);
router.get('/stats', deviceWarningController.getWarningStats);
router.get('/:id', deviceWarningController.getDeviceWarningById);
router.post('/', deviceWarningController.createDeviceWarning);
router.put('/:id', deviceWarningController.updateDeviceWarning);
router.delete('/:id', deviceWarningController.deleteDeviceWarning);
router.patch('/:id/status', deviceWarningController.updateWarningStatus);

module.exports = router;
