Files
Mutual_Fund/schemas/auth.py

14 lines
519 B
Python

"""认证相关 DTO。"""
from pydantic import BaseModel, Field
class LoginReq(BaseModel):
username: str = Field(min_length=1, max_length=64)
password: str = Field(min_length=1, max_length=128)
class RegisterReq(BaseModel):
username: str = Field(min_length=1, max_length=64)
password: str = Field(min_length=8, max_length=128, description="密码至少 8 位")
phone: str = Field(pattern=r"^1\d{10}$", description="11 位手机号")
real_name: str | None = Field(default=None, max_length=32)