feat(tkuser): 알림 수신자 탭에 ntfy 구독 관리 추가

- notificationRecipientModel에 ntfy CRUD 메서드 추가 (같은 DB 직접 쿼리)
- ntfy 라우트 3개 추가 (GET/POST/DELETE, /:type 위에 배치)
- 알림 수신자 탭 상단에 ntfy 구독 관리 카드 렌더링
- ntfy 추가 모달에 앱 설정 안내 문구 포함

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-17 15:16:14 +09:00
parent 1cef745cc9
commit f548a95767
5 changed files with 187 additions and 3 deletions

View File

@@ -138,6 +138,29 @@ const notificationRecipientModel = {
return !!row;
},
// === ntfy 구독 관리 ===
async getNtfySubscribers() {
const db = getPool();
const [rows] = await db.query(`
SELECT ns.user_id, ns.created_at, u.username, u.name as user_name
FROM ntfy_subscriptions ns
JOIN sso_users u ON u.user_id = ns.user_id
ORDER BY u.name
`);
return rows;
},
async addNtfySubscription(userId) {
const db = getPool();
await db.query('INSERT IGNORE INTO ntfy_subscriptions (user_id) VALUES (?)', [userId]);
},
async removeNtfySubscription(userId) {
const db = getPool();
await db.query('DELETE FROM ntfy_subscriptions WHERE user_id = ?', [userId]);
},
// 유형별 수신자 일괄 설정
async setRecipients(notificationType, userIds, createdBy = null) {
const db = getPool();