hisham-cmd's picture
Full Sync: Explicit Commit Operations (Pure & Optimized)
b2be963 verified
Raw
History Blame Contribute Delete
1.2 kB
from datetime import datetime
from typing import Optional
from pydantic import BaseModel, EmailStr, Field
class RegisterRequest(BaseModel):
name: str = Field(..., min_length=2, max_length=255)
email: str = Field(..., max_length=255)
password: str = Field(..., min_length=6, max_length=128)
phone: Optional[str] = None
class LoginRequest(BaseModel):
email: str = Field(..., max_length=255)
password: str = Field(..., min_length=1, max_length=128)
class GoogleLoginRequest(BaseModel):
credential: str = Field(..., description="Google ID token from frontend")
class RefreshRequest(BaseModel):
refresh_token: str
class TokenResponse(BaseModel):
access_token: str
refresh_token: str
token_type: str = "bearer"
class UserResponse(BaseModel):
id: int
name: str
email: str
phone: Optional[str] = None
role: str
avatar_url: Optional[str] = None
auth_provider: str
created_at: datetime
model_config = {"from_attributes": True}
class AuthResponse(BaseModel):
isSuccess: bool
value: Optional[dict] = None
error: Optional[str] = None
statusCode: int