feature:新增邮箱注册登录功能
This commit is contained in:
@@ -43,6 +43,47 @@ class SettingsResponse(SettingsBase):
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class SystemSMTPSettingsBase(BaseModel):
|
||||
"""系统 SMTP 设置基础模型"""
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
smtp_provider: str = Field(default="qq", description="SMTP 提供商")
|
||||
smtp_host: Optional[str] = Field(default=None, description="SMTP 主机")
|
||||
smtp_port: int = Field(default=465, ge=1, le=65535, description="SMTP 端口")
|
||||
smtp_username: Optional[str] = Field(default=None, description="SMTP 用户名")
|
||||
smtp_password: Optional[str] = Field(default=None, description="SMTP 密码或授权码")
|
||||
smtp_use_tls: bool = Field(default=False, description="是否启用 TLS")
|
||||
smtp_use_ssl: bool = Field(default=True, description="是否启用 SSL")
|
||||
smtp_from_email: Optional[str] = Field(default=None, description="发件人邮箱")
|
||||
smtp_from_name: str = Field(default="MuMuAINovel", description="发件人名称")
|
||||
email_auth_enabled: bool = Field(default=True, description="是否启用邮箱认证")
|
||||
email_register_enabled: bool = Field(default=True, description="是否启用邮箱注册")
|
||||
verification_code_ttl_minutes: int = Field(default=10, ge=1, le=120, description="验证码有效期(分钟)")
|
||||
verification_resend_interval_seconds: int = Field(default=60, ge=10, le=3600, description="验证码重发间隔(秒)")
|
||||
|
||||
|
||||
class SystemSMTPSettingsUpdate(SystemSMTPSettingsBase):
|
||||
"""系统 SMTP 设置更新模型"""
|
||||
pass
|
||||
|
||||
|
||||
class SystemSMTPSettingsResponse(SystemSMTPSettingsBase):
|
||||
"""系统 SMTP 设置响应模型"""
|
||||
model_config = ConfigDict(from_attributes=True, protected_namespaces=())
|
||||
|
||||
id: str
|
||||
user_id: str
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class SMTPTestRequest(BaseModel):
|
||||
"""SMTP 测试请求模型"""
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
to_email: str = Field(..., min_length=3, max_length=255, description="测试收件邮箱")
|
||||
|
||||
|
||||
# ========== API配置预设相关模型 ==========
|
||||
|
||||
class APIKeyPresetConfig(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user