Files
QuestionProject/ai_knowledge_base_v2/apps/backend/app/schemas/auth.py

31 lines
682 B
Python

from __future__ import annotations
from datetime import datetime
from pydantic import BaseModel, Field
from app.schemas.user import UserProfile
class SendSmsRequest(BaseModel):
phone: str = Field(min_length=11, max_length=20)
captchaId: str = Field(min_length=1, max_length=100)
captchaCode: str = Field(min_length=4, max_length=8)
class LoginRequest(BaseModel):
phone: str = Field(min_length=11, max_length=20)
code: str = Field(min_length=4, max_length=8)
class LoginResponse(BaseModel):
token: str
expiredAt: datetime
user: UserProfile
class CaptchaResponse(BaseModel):
captchaId: str
imageBase64: str
expiresInSeconds: int