[rewrite] Major changes to code - switched to postgres, added initial backend docker files
This commit is contained in:
1 parent
c7e20fc935
commit
71e916586e
52 files changed
+783
-537
No files matched your search
@@ -1,7 +1,8 @@
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
from sqlmodel import Field as SqlModelField, SQLModel
|
||||
from pydantic import EmailStr, Field
|
||||
|
||||
|
||||
class UserRegisterSchema(BaseModel):
|
||||
class UserRegisterSchema(SQLModel):
|
||||
username: str = Field(..., min_length=3, max_length=64)
|
||||
email: EmailStr = Field(...)
|
||||
phone_number: str = Field(..., min_length=2, max_length=16, pattern=r'^\+[1-9]\d{1,14}$')
|
||||
@@ -9,9 +10,19 @@ class UserRegisterSchema(BaseModel):
|
||||
shop_id: int = 0
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
class UserLoginSchema(BaseModel):
|
||||
|
||||
class UserLoginSchema(SQLModel):
|
||||
shop_id: int = 0
|
||||
username: str = Field(..., min_length=3, max_length=64)
|
||||
password: str = Field(..., min_length=6, max_length=128)
|
||||
password: str = Field(..., min_length=6, max_length=128)
|
||||
|
||||
|
||||
class Token(SQLModel):
|
||||
access_token: str
|
||||
token_type: str = "bearer"
|
||||
|
||||
|
||||
class TokenPayload(SQLModel):
|
||||
sub: str | None = None
|
||||
Reference in new issue
Block a user