集成家长短信通知

This commit is contained in:
stu2not
2026-06-03 15:14:01 +08:00
parent c4d977ce99
commit 482fbf351f
13 changed files with 1027 additions and 23 deletions

View File

@@ -22,6 +22,7 @@ from handlers.prompt_sound_handler import handle_prompt_sound_request
from handlers.session_cleanup_handler import handle_old_session_cleanup
from config import settings
from banban.service.im import im_service as im_conversation_service
from banban.service.sms_notification import sms_notification_service
from utils.audio_format import detect_audio_format, wrap_pcm_as_wav
from fastapi import HTTPException
@@ -287,7 +288,7 @@ async def process_parent_leave_message(device_id: str, audio_cache_key: str):
content_type=media_mime_type,
extension=extension,
)
await im_conversation_service.create_device_parent_leave_message(
device_identity, _ = await im_conversation_service.create_device_parent_leave_message(
device_id=device_id,
media_file_key=stored_audio.file_key,
media_mime_type=media_mime_type,
@@ -300,6 +301,10 @@ async def process_parent_leave_message(device_id: str, audio_cache_key: str):
},
audio_content=archive_audio,
)
sms_notification_service.schedule_leave_message_notification(
device_id=device_id,
child_name=device_identity.child_name,
)
session_logger.info(
device_id,
"parent",