41 lines
797 B
Python
41 lines
797 B
Python
from datetime import datetime
|
|
from uuid import UUID
|
|
from pydantic import ConfigDict
|
|
from fastapi import Form
|
|
|
|
from backend.schemas.main_model import MainModel
|
|
|
|
class UserBase(MainModel):
|
|
username: str = Form(...)
|
|
|
|
class UserRequest(UserBase):
|
|
password: str = Form(...)
|
|
|
|
class UserCreate(UserRequest):
|
|
name: str
|
|
|
|
class UserSeeds(UserCreate):
|
|
is_admin: bool
|
|
is_lock: bool
|
|
|
|
class PrivateUser(UserBase):
|
|
id: UUID
|
|
name: str
|
|
is_admin: bool
|
|
is_lock: bool
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
class ProfileResponse(UserBase):
|
|
name: str
|
|
is_admin: bool
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
class LoginResponse(MainModel):
|
|
access_token: str
|
|
exp: int
|
|
name: str
|