"""认证相关 Pydantic schema。""" from pydantic import BaseModel, EmailStr, Field class LoginRequest(BaseModel): """登录请求。""" email: EmailStr password: str = Field(..., min_length=6, max_length=128) class RegisterRequest(BaseModel): """注册请求。""" email: EmailStr password: str = Field(..., min_length=6, max_length=128) name: str = Field(..., min_length=1, max_length=100) tenant_name: str = Field(..., min_length=1, max_length=200) role: str = Field(default="founder", description="角色:gp/partner/post_invest_lead/investor/founder/admin") class TokenResponse(BaseModel): """Token 响应。""" access_token: str refresh_token: str token_type: str = "bearer" expires_in: int = Field(description="access token 有效期(秒)") class RefreshRequest(BaseModel): """刷新 token 请求。""" refresh_token: str class UserInfo(BaseModel): """用户信息。""" id: str email: str name: str role: str tenant_id: str is_active: bool