- 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>
30 lines
578 B
Python
30 lines
578 B
Python
"""
|
|
消息相关 Schema
|
|
"""
|
|
from typing import Optional, List
|
|
from datetime import datetime
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class MessageResponse(BaseModel):
|
|
id: str
|
|
type: str
|
|
title: str
|
|
content: str
|
|
is_read: bool
|
|
related_task_id: Optional[str] = None
|
|
related_project_id: Optional[str] = None
|
|
sender_name: Optional[str] = None
|
|
created_at: Optional[datetime] = None
|
|
|
|
|
|
class MessageListResponse(BaseModel):
|
|
items: List[MessageResponse]
|
|
total: int
|
|
page: int
|
|
page_size: int
|
|
|
|
|
|
class UnreadCountResponse(BaseModel):
|
|
count: int
|