This commit is contained in:
2025-04-17 23:32:39 +09:00
commit 5b719b6766
105 changed files with 25653 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
/**
* 알림 라우트
* 사용자 알림 관련 API
*/
const express = require('express');
const router = express.Router();
const notificationController = require('../controllers/notificationController');
const { check } = require('express-validator');
const { authenticateJWT } = require('../middleware/authMiddleware');
// 사용자 알림 목록 가져오기
router.get('/', authenticateJWT, notificationController.getUserNotifications);
// 알림 읽음 표시
router.put('/:notificationId/read', authenticateJWT, notificationController.markAsRead);
// 모든 알림 읽음 표시
router.put('/read-all', authenticateJWT, notificationController.markAllAsRead);
// 알림 삭제
router.delete('/:notificationId', authenticateJWT, notificationController.deleteNotification);
// 알림 생성 (관리자 전용)
router.post('/',
authenticateJWT,
[
check('userId', '사용자 ID가 필요합니다.').not().isEmpty(),
check('title', '알림 제목이 필요합니다.').not().isEmpty(),
check('message', '알림 내용이 필요합니다.').not().isEmpty()
],
notificationController.createNotification
);
module.exports = router;