Загрузить файлы в «app»
This commit is contained in:
51
app/schemas.py
Normal file
51
app/schemas.py
Normal file
@@ -0,0 +1,51 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
|
||||
|
||||
class UserRegister(BaseModel):
|
||||
email: EmailStr
|
||||
password: str = Field(min_length=6, max_length=128)
|
||||
|
||||
|
||||
class UserLogin(BaseModel):
|
||||
email: EmailStr
|
||||
password: str
|
||||
|
||||
|
||||
class UserPublic(BaseModel):
|
||||
id: int
|
||||
email: str
|
||||
rating: float
|
||||
points: int
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class SessionPublic(BaseModel):
|
||||
id: int
|
||||
created_at: datetime
|
||||
expires_at: datetime
|
||||
is_active: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class ExternalDataCreate(BaseModel):
|
||||
source: str = Field(min_length=1, max_length=128)
|
||||
payload: dict | str
|
||||
points_delta: int = 0
|
||||
rating_delta: float = 0.0
|
||||
|
||||
|
||||
class ExternalDataPublic(BaseModel):
|
||||
id: int
|
||||
source: str
|
||||
payload: str
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user