TK-FB(공장관리+신고)와 M-Project(부적합관리)를 3개 독립 시스템으로 분리하기 위한 전체 코드 구조 작성. - SSO 인증 서비스 (bcrypt + pbkdf2 이중 해시 지원) - System 1: 공장관리 (TK-FB 기반, 신고 코드 제거) - System 2: 신고 (TK-FB에서 workIssue 코드 추출) - System 3: 부적합관리 (M-Project 기반) - Gateway 포털 (path-based 라우팅) - 통합 docker-compose.yml 및 배포 스크립트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
// routes/notificationRoutes.js
|
|
const express = require('express');
|
|
const router = express.Router();
|
|
const notificationController = require('../controllers/notificationController');
|
|
const { requireAuth, requireMinLevel } = require('../middlewares/auth');
|
|
|
|
// 모든 알림 라우트는 인증 필요
|
|
router.use(requireAuth);
|
|
|
|
// 읽지 않은 알림 조회 (본인 알림만)
|
|
router.get('/unread', notificationController.getUnread);
|
|
|
|
// 읽지 않은 알림 개수
|
|
router.get('/unread/count', notificationController.getUnreadCount);
|
|
|
|
// 전체 알림 조회 (페이징)
|
|
router.get('/', notificationController.getAll);
|
|
|
|
// 알림 생성 (시스템/관리자용)
|
|
router.post('/', requireMinLevel('support_team'), notificationController.create);
|
|
|
|
// 모든 알림 읽음 처리 (본인 알림만)
|
|
router.post('/read-all', notificationController.markAllAsRead);
|
|
|
|
// 특정 알림 읽음 처리 (본인 알림만)
|
|
router.post('/:id/read', notificationController.markAsRead);
|
|
|
|
// 알림 삭제 (본인 알림만)
|
|
router.delete('/:id', notificationController.delete);
|
|
|
|
module.exports = router;
|