/**
 * 리스크/알림 라우터
 */

import { Router } from 'express';
import { RiskAlertController } from '../controllers/riskAlertController';
import { authenticateToken } from '../middleware/authMiddleware';

const router = Router();
const riskAlertController = new RiskAlertController();

// 전체 알림 조회 (캐시된 데이터)
router.get('/', authenticateToken, (req, res) => riskAlertController.getAllAlerts(req, res));

// 알림 강제 갱신
router.post('/refresh', authenticateToken, (req, res) => riskAlertController.refreshAlerts(req, res));

// 날씨 특보 조회
router.get('/weather', authenticateToken, (req, res) => riskAlertController.getWeatherAlerts(req, res));

// 교통사고 조회
router.get('/accidents', authenticateToken, (req, res) => riskAlertController.getAccidentAlerts(req, res));

// 도로공사 조회
router.get('/roadworks', authenticateToken, (req, res) => riskAlertController.getRoadworkAlerts(req, res));

export default router;

