a9d1b0e416
上轮 3 次 commit 只入库了修补文件,主体目录漏入库。本次补入 backend/app/、backend/requirements.txt、backend/scripts/__init__.py。同步在 .gitignore 加 homePC/(制片人家用机带过来的参考文件,不进库)。
25 lines
488 B
Python
25 lines
488 B
Python
"""
|
|
认证相关 Pydantic Schema — 请求 / 响应模型
|
|
"""
|
|
|
|
from pydantic import BaseModel
|
|
|
|
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
|
|
|
|
class Config:
|
|
from_attributes = True |