- Profile API: GET/PUT /profile + PUT /profile/password - Messages API: 模型/迁移(005)/服务/路由 + 任务操作自动创建消息 - SSE 推送集成: tasks.py 中 6 个操作触发 SSE 通知 - Alembic 迁移: 004 audit_logs + 005 messages - env.py 导入所有模型确保迁移正确 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
54 lines
1.3 KiB
Python
54 lines
1.3 KiB
Python
"""
|
|
数据库模型
|
|
导出所有 ORM 模型
|
|
"""
|
|
from app.models.base import Base, TimestampMixin
|
|
from app.models.user import User, UserRole
|
|
from app.models.organization import Brand, Agency, Creator, brand_agency_association, agency_creator_association
|
|
from app.models.project import Project, project_agency_association
|
|
from app.models.task import Task, TaskStage, TaskStatus
|
|
from app.models.brief import Brief
|
|
from app.models.ai_config import AIConfig
|
|
from app.models.review import ReviewTask, Platform
|
|
from app.models.rule import ForbiddenWord, WhitelistItem, Competitor
|
|
from app.models.audit_log import AuditLog
|
|
from app.models.message import Message
|
|
# 保留 Tenant 兼容旧代码,但新代码应使用 Brand
|
|
from app.models.tenant import Tenant
|
|
|
|
__all__ = [
|
|
# Base
|
|
"Base",
|
|
"TimestampMixin",
|
|
# 用户与组织
|
|
"User",
|
|
"UserRole",
|
|
"Brand",
|
|
"Agency",
|
|
"Creator",
|
|
"brand_agency_association",
|
|
"agency_creator_association",
|
|
# 项目与任务
|
|
"Project",
|
|
"project_agency_association",
|
|
"Task",
|
|
"TaskStage",
|
|
"TaskStatus",
|
|
"Brief",
|
|
# AI 配置
|
|
"AIConfig",
|
|
# 审核
|
|
"ReviewTask",
|
|
"Platform",
|
|
# 规则
|
|
"ForbiddenWord",
|
|
"WhitelistItem",
|
|
"Competitor",
|
|
# 审计日志
|
|
"AuditLog",
|
|
# 消息
|
|
"Message",
|
|
# 兼容
|
|
"Tenant",
|
|
]
|