第一次提交

This commit is contained in:
2026-08-01 16:50:55 +08:00
commit c8f9e39039
68 changed files with 6016 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
"""认证相关的请求/响应 schema。"""
from pydantic import BaseModel, ConfigDict, Field
class RegisterRequest(BaseModel):
username: str = Field(min_length=3, max_length=64)
password: str = Field(min_length=6, max_length=128)
email: str | None = Field(default=None, max_length=255)
class Token(BaseModel):
access_token: str
token_type: str = "bearer"
class UserOut(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: str
username: str
email: str | None
is_active: bool