"""
认证相关 Pydantic Schema — 请求 / 响应模型
"""

from pydantic import BaseModel, ConfigDict

from app.models.user import UserRole


class LoginRequest(BaseModel):
    username: str
    password: str


class UserResponse(BaseModel):
    """返回给前端的用户信息（不含 password_hash）。"""
    id: int
    username: str
    display_name: str
    role: UserRole
    profile_text: str | None = None
    is_active: bool = True

    model_config = ConfigDict(from_attributes=True)