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

// 应用认证中间件
router.use(authMiddleware);

// 防疫数据统计
router.get('/stats', (req, res) => {
  res.json({ 
    code: 200, 
    data: {
      vaccinated: 0,
      tested: 0
    }
  });
});

// 防疫机构管理
router.get('/agencies', epidemicAgencyController.getEpidemicAgencies);
router.get('/agencies/:id', epidemicAgencyController.getEpidemicAgencyById);
router.post('/agencies', epidemicAgencyController.createEpidemicAgency);
router.put('/agencies/:id', epidemicAgencyController.updateEpidemicAgency);
router.delete('/agencies/:id', epidemicAgencyController.deleteEpidemicAgency);
router.patch('/agencies/:id/status', epidemicAgencyController.toggleEpidemicAgencyStatus);

module.exports = router;