2026-08-07 11:44:04 +08:00
|
|
|
"""通知 Pydantic Schema"""
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
import uuid
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NotificationResponse(BaseModel):
|
|
|
|
|
"""通知列表响应"""
|
|
|
|
|
id: uuid.UUID
|
|
|
|
|
user_id: str
|
|
|
|
|
title: str
|
|
|
|
|
content: str
|
|
|
|
|
type: str
|
|
|
|
|
task_id: uuid.UUID | None = None
|
2026-08-11 15:56:25 +08:00
|
|
|
product_serial_number: str | None = None
|
2026-08-07 11:44:04 +08:00
|
|
|
is_read: bool
|
|
|
|
|
created_at: datetime
|
|
|
|
|
|
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NotificationListResponse(BaseModel):
|
|
|
|
|
"""通知分页列表"""
|
|
|
|
|
notifications: list[NotificationResponse]
|
|
|
|
|
total: int
|
|
|
|
|
unread_count: int
|