mirror of
https://github.com/StepanovPlaton/torrent_backend.git
synced 2026-04-03 20:30:38 +04:00
Add authorization
This commit is contained in:
@@ -1 +1,2 @@
|
||||
from .games import *
|
||||
from .users import *
|
||||
|
||||
19
database/schemas/users.py
Normal file
19
database/schemas/users.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from typing import Optional
|
||||
from fastapi import Body
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class UserBase(BaseModel):
|
||||
email: str = Field(examples=["email@gmail.com"])
|
||||
name: str = Field(examples=["username"])
|
||||
|
||||
|
||||
class UserCreate(UserBase):
|
||||
password: str = Field(examples=["password"])
|
||||
|
||||
|
||||
class User(UserBase):
|
||||
id: int = Field(examples=[1])
|
||||
hash_of_password: str = Field(examples=["hash_of_password"])
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user