refactor(notification_sender): 移除对 HfcContext 的依赖并简化方法签名

This commit is contained in:
Windpicker-owo
2025-09-23 22:52:32 +08:00
parent 7f83fde082
commit c3b153f8c6

View File

@@ -1,12 +1,13 @@
from src.common.logger import get_logger from src.common.logger import get_logger
from ..hfc_context import HfcContext
#from ..hfc_context import HfcContext
logger = get_logger("notification_sender") logger = get_logger("notification_sender")
class NotificationSender: class NotificationSender:
@staticmethod @staticmethod
async def send_goodnight_notification(context: HfcContext): async def send_goodnight_notification(context): # type: ignore
"""发送晚安通知""" """发送晚安通知"""
#try: #try:
#from ..proactive.events import ProactiveTriggerEvent #from ..proactive.events import ProactiveTriggerEvent
@@ -19,7 +20,7 @@ class NotificationSender:
#logger.error(f"发送晚安通知失败: {e}") #logger.error(f"发送晚安通知失败: {e}")
@staticmethod @staticmethod
async def send_insomnia_notification(context: HfcContext, reason: str): async def send_insomnia_notification(context, reason: str): # type: ignore
"""发送失眠通知""" """发送失眠通知"""
#try: #try:
#from ..proactive.events import ProactiveTriggerEvent #from ..proactive.events import ProactiveTriggerEvent