refactor: 优化API路由和响应模型 feat(admin): 添加App用户管理接口 feat(sms): 实现阿里云短信服务集成 feat(email): 添加SMTP邮件发送功能 feat(upload): 支持文件上传接口 feat(rate-limiter): 实现手机号限流器 fix: 修复计算步骤入库问题 docs: 更新API文档和测试计划 chore: 更新依赖和配置
25 lines
663 B
Python
25 lines
663 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
|
|
|
|
class SendEmailRequest(BaseModel):
|
|
email: str = Field(..., description="邮箱地址")
|
|
subject: Optional[str] = Field(None, description="邮件主题")
|
|
body: str = Field(..., description="文案内容")
|
|
file_url: Optional[str] = Field(None, description="附件URL")
|
|
|
|
|
|
class SendEmailResponse(BaseModel):
|
|
status: str
|
|
log_id: Optional[int] = None
|
|
error: Optional[str] = None
|
|
|
|
|
|
class EmailSendLogOut(BaseModel):
|
|
id: int
|
|
email: str
|
|
subject: Optional[str]
|
|
body_summary: Optional[str]
|
|
file_name: Optional[str]
|
|
file_url: Optional[str]
|
|
status: str |