mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
24 lines
655 B
Python
24 lines
655 B
Python
from typing import List
|
|
|
|
from app.db.systemconfig_oper import SystemConfigOper
|
|
from app.schemas import NotificationConf
|
|
from app.schemas.types import SystemConfigKey
|
|
|
|
|
|
class NotificationHelper:
|
|
"""
|
|
消息通知渠道帮助类
|
|
"""
|
|
|
|
def __init__(self):
|
|
self.systemconfig = SystemConfigOper()
|
|
|
|
def get_notifications(self) -> List[NotificationConf]:
|
|
"""
|
|
获取消息通知渠道
|
|
"""
|
|
notification_confs: List[dict] = self.systemconfig.get(SystemConfigKey.Notifications)
|
|
if not notification_confs:
|
|
return []
|
|
return [NotificationConf(**conf) for conf in notification_confs]
|