from datetime import datetime
from typing import Optional

from pydantic import BaseModel, Field


class IdentityQrGenerateResponse(BaseModel):
    token: str = Field(..., description="AES-GCM 加密后 Base64 URL-safe 字符串")
    expires_at: datetime = Field(..., description="过期时间（UTC）")


class IdentityQrVerifyRequest(BaseModel):
    token: str = Field(..., min_length=1)


class IdentityQrVerifyResponse(BaseModel):
    id: int
    name: Optional[str] = None
    mobile: str
