Modules¶
Birthday Reminder System
Core Modules¶
配置管理模块
- class src.core.config.SMTPConfig(host: str, port: int, username: str, password: str, use_tls: bool = True, default_receive_email: str | None = None, default_template_file: str = 'birthday.html', default_reminder_days: int = 0)[source]¶
Bases:
objectSMTP服务器配置
- class src.core.config.ServerChanConfig(default_sckey: str | None = None, default_reminder_days: int = 0)[source]¶
Bases:
object
- class src.core.config.Recipient(name: str, email: str | None = None, solar_birthday: str | None = None, lunar_birthday: str | None = None, reminder_days: int | None = None, template_file: str | None = None)[source]¶
Bases:
object收件人信息
- class src.core.config.Config(smtp_config: SMTPConfig | None, serverchan_config: ServerChanConfig | None, recipients: List[Recipient], notification_types: List[str])[source]¶
Bases:
object应用配置
- smtp_config: SMTPConfig | None¶
- serverchan_config: ServerChanConfig | None¶
- __init__(smtp_config: SMTPConfig | None, serverchan_config: ServerChanConfig | None, recipients: List[Recipient], notification_types: List[str]) None¶
配置管理器 - 简单实用的配置管理
- class src.core.config_manager.ConfigManager(config_path: str | None = None)[source]¶
Bases:
object配置管理器 - 只做必要的配置管理
生日检查模块
通知发送器工厂 - 简单实用的对象创建
Notification Modules¶
- src.notification.sender_email.retry_on_failure(max_retries=3, delay=1, backoff=2)[source]¶
重试装饰器 - 支持指数退避
- class src.notification.sender_email.EmailSender(smtp_config: SMTPConfig, templates_dir: str)[source]¶
Bases:
NotificationBase- __init__(smtp_config: SMTPConfig, templates_dir: str)[source]¶