핵심 기능: 1. app-distribution-dev: 모바일 앱 QR 배포 (APK→QR→랜딩→설치) 2. itsm-ux-dev: ITSM 준비중 뷰 8개 완성 + 배치 SSH + D3 의존성 맵 3. mail-enhance-dev: 웹메일 주소록·서명·폴더 관리 4. asset-qr-dev: 서버 QR 태그→스캔→CMDB 조회·실사 5. notification-ui-dev: 노코드 알림 규칙 편집기 + 스마트 필터 목표: 774→~810 엔드포인트 QR 배포: 앱스토어 없이 Manager QR 스캔으로 즉시 설치 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
105 lines
4.1 KiB
Markdown
105 lines
4.1 KiB
Markdown
# notification-ui-dev
|
|
|
|
## 핵심 역할
|
|
**알림 규칙 시각적 편집기**와 **스마트 알림 시스템**을 구현한다.
|
|
현재 코드 기반 알림 설정을 UI로 노코드화하고,
|
|
AI 기반 스마트 알림 필터링을 추가한다.
|
|
|
|
## 구현 범위
|
|
|
|
### 1. Manager 신규 페이지: `NotificationRules.tsx`
|
|
|
|
드래그앤드롭 방식의 알림 규칙 편집기:
|
|
```
|
|
┌─ 트리거 선택 ─────────────────────┐
|
|
│ [SR 생성됨] [인시던트 발생] [드리프트] │
|
|
└──────────────────────────────────┘
|
|
↓ 조건 추가
|
|
┌─ 조건 설정 ────────────────────────┐
|
|
│ 우선순위: [HIGH ▼] AND │
|
|
│ 카테고리: [MONITORING ▼] │
|
|
└──────────────────────────────────┘
|
|
↓ 액션 추가
|
|
┌─ 알림 채널 ────────────────────────┐
|
|
│ ☑ 메신저(카카오/슬랙) ☑ 이메일 │
|
|
│ ☑ SMS ☐ Webhook │
|
|
└──────────────────────────────────┘
|
|
```
|
|
|
|
### 2. ITSM 신규 라우터: `smart_notify.py`
|
|
```python
|
|
GET /api/smart-notify/rules — 알림 규칙 목록
|
|
POST /api/smart-notify/rules — 규칙 생성 (노코드 UI 연동)
|
|
PUT /api/smart-notify/rules/{id} — 규칙 수정
|
|
DELETE /api/smart-notify/rules/{id}— 규칙 삭제
|
|
POST /api/smart-notify/test — 규칙 테스트 발송
|
|
GET /api/smart-notify/logs — 발송 이력
|
|
POST /api/smart-notify/silence — 특정 기간 무음 설정
|
|
GET /api/smart-notify/digest — 일괄 요약 알림 설정
|
|
```
|
|
|
|
### 3. 스마트 알림 필터 (AI)
|
|
```python
|
|
# 중복 알림 묶음 처리
|
|
# 야간/주말 알림 억제 (긴급 제외)
|
|
# 사용자별 알림 피로도 관리
|
|
# Ollama 기반 알림 중요도 자동 분류
|
|
|
|
async def smart_filter(notification: dict) -> dict:
|
|
# 최근 1시간 동일 유형 알림 수 체크
|
|
# 5개 초과 시 묶음 발송
|
|
# 야간(22시~8시) P3/P4는 억제
|
|
# Ollama로 중요도 재평가
|
|
pass
|
|
```
|
|
|
|
### 4. 앱 업데이트 알림 (app-distribution-dev 연동)
|
|
```python
|
|
# 새 APK 업로드 시 자동 알림
|
|
# 메신저 + 이메일 + 앱 인앱 알림
|
|
async def notify_new_version(version: str, download_url: str):
|
|
await send_messenger("새 GUARDiA 앱 v{version} 배포됨. QR 스캔으로 설치 → {url}")
|
|
```
|
|
|
|
### 5. ITSM 사이드바 메뉴 추가
|
|
```javascript
|
|
{ label: '알림 규칙 편집기', nav: 'notification_rules' }
|
|
```
|
|
|
|
### DB 모델
|
|
```python
|
|
class SmartNotifyRule(Base):
|
|
__tablename__ = "tb_smart_notify_rule"
|
|
id = Column(Integer, primary_key=True)
|
|
tenant_id = Column(Integer)
|
|
name = Column(String(200))
|
|
trigger_type = Column(String(50)) # SR_CREATED | INCIDENT | DRIFT
|
|
conditions = Column(JSON) # 조건 목록
|
|
channels = Column(JSON) # 발송 채널
|
|
priority_filter = Column(String(50)) # HIGH | MEDIUM | ALL
|
|
silence_hours = Column(JSON) # 무음 시간대
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime)
|
|
|
|
class NotifyLog(Base):
|
|
__tablename__ = "tb_notify_log"
|
|
id = Column(Integer, primary_key=True)
|
|
rule_id = Column(Integer)
|
|
channel = Column(String(30))
|
|
recipient = Column(String(200))
|
|
message = Column(Text)
|
|
status = Column(String(20)) # SENT | FAILED | SILENCED
|
|
sent_at = Column(DateTime)
|
|
```
|
|
|
|
## 작업 원칙
|
|
1. 노코드 규칙 편집기 — 기술 지식 없는 관리자도 사용 가능
|
|
2. 기존 `messenger.py`, `notifications.py` 연동
|
|
3. AI 필터는 온프레미스 Ollama만 사용
|
|
4. 무음 설정은 긴급(P1/P2) 제외
|
|
|
|
## 팀 통신 프로토콜
|
|
- **수신**: app-distribution-dev에서 앱 업데이트 알림 요청
|
|
- **수신**: mail-enhance-dev에서 새 메일 알림 패턴 공유
|
|
- **발신**: itsm-ux-dev에 알림 편집기 뷰 패턴 제공
|