const express = require('express');
const router = express.Router();
const supervisionTaskController = require('../controllers/supervisionTaskController');
const { authMiddleware } = require('../middleware/auth');

// 应用认证中间件到所有路由
router.use(authMiddleware);

// 获取监管任务列表
// GET /api/supervision-tasks
router.get('/', supervisionTaskController.getSupervisionTasks);

// 获取监管任务统计
// GET /api/supervision-tasks/stats
router.get('/stats', supervisionTaskController.getSupervisionTaskStats);

// 获取监管任务详情
// GET /api/supervision-tasks/:id
router.get('/:id', supervisionTaskController.getSupervisionTaskById);

// 创建监管任务
// POST /api/supervision-tasks
router.post('/', supervisionTaskController.createSupervisionTask);

// 更新监管任务
// PUT /api/supervision-tasks/:id
router.put('/:id', supervisionTaskController.updateSupervisionTask);

// 删除监管任务
// DELETE /api/supervision-tasks/:id
router.delete('/:id', supervisionTaskController.deleteSupervisionTask);

// 批量更新监管任务状态
// PUT /api/supervision-tasks/batch/status
router.put('/batch/status', supervisionTaskController.batchUpdateStatus);

// 批量删除监管任务
// DELETE /api/supervision-tasks/batch
router.delete('/batch', supervisionTaskController.batchDeleteTasks);

module.exports = router;
