// routes/pushSubscriptionRoutes.js
const express = require('express');
const router = express.Router();
const pushController = require('../controllers/pushSubscriptionController');
const { requireAuth } = require('../middleware/auth');

// VAPID 공개키 (인증 불필요)
router.get('/vapid-public-key', pushController.getVapidPublicKey);

// 구독/해제 (인증 필요)
router.post('/subscribe', requireAuth, pushController.subscribe);
router.delete('/unsubscribe', requireAuth, pushController.unsubscribe);

// ntfy 구독 관리
router.post('/ntfy/subscribe', requireAuth, pushController.ntfySubscribe);
router.delete('/ntfy/unsubscribe', requireAuth, pushController.ntfyUnsubscribe);
router.get('/ntfy/status', requireAuth, pushController.ntfyStatus);

module.exports = router;
