首个可运行的版本

This commit is contained in:
2026-06-12 23:14:12 +08:00
commit b3d90c65f8
86 changed files with 4808 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
"""认证相关 Schema"""
from pydantic import BaseModel, EmailStr, Field
class RegisterRequest(BaseModel):
username: str = Field(..., min_length=2, max_length=50)
email: EmailStr
password: str = Field(..., min_length=6, max_length=100)
class LoginRequest(BaseModel):
username: str
password: str
class TokenResponse(BaseModel):
access_token: str
refresh_token: str
token_type: str = "bearer"
user: "UserBrief"
class RefreshRequest(BaseModel):
refresh_token: str
class UserBrief(BaseModel):
id: str
username: str
avatar_url: str | None = None
is_admin: bool = False
model_config = {"from_attributes": True}