import arlo

This commit is contained in:
konjacpotato
2025-11-05 21:00:19 +08:00
commit 2c8426d543
69 changed files with 789 additions and 0 deletions

View File

View File

@ -0,0 +1,21 @@
from database.database import get_session
from database.thealthknowledge.health_knowledge import get_oldest_unused_data, mark_data_as_used
from database.tscheduler.model import TScheduler
from log.log_manager import log
from mail.mail_manager import send_mail
def send_health_knowledge_mail_task(scheduler: TScheduler):
with get_session() as db:
# 获取需要发送的内容列表
health_knowledge = get_oldest_unused_data(db)
# 发送邮件
subject = health_knowledge.subject
content = health_knowledge.knowledge
send_mail(subject, content, receiver_email="lu9531@126.com")
log(f"send mail success with title {subject}, content {content[:20]}.")
# 更新数据库
mark_data_as_used(db, health_knowledge)
if __name__ == '__main__':
send_health_knowledge_mail_task(TScheduler())