Инициализация в новом репозитории
This commit is contained in:
commit
eb1f18f53e
374 changed files with 226678 additions and 0 deletions
23
SRV/models/auth.py
Normal file
23
SRV/models/auth.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# models.py
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
class UserCreate(BaseModel):
|
||||
username: str
|
||||
password: str
|
||||
is_admin: bool = False
|
||||
|
||||
class UserLogin(BaseModel):
|
||||
username: str
|
||||
password: str
|
||||
|
||||
class UserResponse(BaseModel):
|
||||
id: int
|
||||
username: str
|
||||
is_admin: bool
|
||||
|
||||
class Token(BaseModel):
|
||||
access_token: str
|
||||
token_type: str
|
||||
session_id: Optional[str] = None
|
||||
user: Optional[UserResponse] = None
|
||||
Loading…
Add table
Add a link
Reference in a new issue