- 인증 없는 임시 엔드포인트 삭제 (index.js, healthRoutes.js, publicPaths) - skipAuth 우회 라우트 삭제 (workAnalysis.js) - 하드코딩 유저 백도어 삭제 (routes/auth.js) - 안전체크 CRUD에 admin 권한 추가 (tbmRoutes.js) - deprecated shim 3개 삭제 + 8개 소비 파일 import 정리 (auth.js 직접 참조) - 미사용 pageAccessController, db.js, common/security.js 삭제 - escapeHtml() 5곳 로컬 중복 제거 → api-base.js 전역 사용 - userPageAccess_v2_v2 캐시 키 버그 수정 (app-init.js) - system3 .bak 파일 삭제, PROGRESS.md 업데이트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
// routes/notificationRecipientRoutes.js
|
|
const express = require('express');
|
|
const router = express.Router();
|
|
const notificationRecipientController = require('../controllers/notificationRecipientController');
|
|
const { verifyToken, requireMinLevel } = require('../middlewares/auth');
|
|
|
|
// 모든 라우트에 인증 필요
|
|
router.use(verifyToken);
|
|
|
|
// 알림 유형 목록
|
|
router.get('/types', notificationRecipientController.getTypes);
|
|
|
|
// 전체 수신자 목록 (유형별 그룹화)
|
|
router.get('/', notificationRecipientController.getAll);
|
|
|
|
// 유형별 수신자 조회
|
|
router.get('/:type', notificationRecipientController.getByType);
|
|
|
|
// 수신자 추가 (관리자만)
|
|
router.post('/', requireMinLevel('admin'), notificationRecipientController.add);
|
|
|
|
// 유형별 수신자 일괄 설정 (관리자만)
|
|
router.put('/:type', requireMinLevel('admin'), notificationRecipientController.setRecipients);
|
|
|
|
// 수신자 제거 (관리자만)
|
|
router.delete('/:type/:userId', requireMinLevel('admin'), notificationRecipientController.remove);
|
|
|
|
module.exports = router;
|