- 复制来源: /home/yueli/track @ 192c8ee (feature/ai-audit-update) - 组织隔离目标: LICA - 端口规划: 前端 8030 / 后端 8031 / 数据库 8032 - 已排除 deploy.sh、deploy_full.sh、docker-compose.prod.yml(IRIS 生产发布脚本) - 已排除工作区未提交改动,取干净的 192c8ee 状态
35 lines
753 B
Python
35 lines
753 B
Python
"""用户 Schemas — 对接 MOM sys_user 表 + 双 Token"""
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
username: str = Field(..., max_length=64)
|
|
password: str = Field(..., max_length=128)
|
|
|
|
|
|
class UserResponse(BaseModel):
|
|
id: str
|
|
username: str
|
|
display_name: str
|
|
role: str
|
|
is_active: bool = True
|
|
created_at: str | None = None
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class LoginResponse(BaseModel):
|
|
access_token: str
|
|
refresh_token: str
|
|
token_type: str = "bearer"
|
|
user: UserResponse
|
|
|
|
|
|
class RefreshRequest(BaseModel):
|
|
refresh_token: str = Field(..., description="Refresh Token")
|
|
|
|
|
|
class RefreshResponse(BaseModel):
|
|
access_token: str
|
|
token_type: str = "bearer"
|