This commit is contained in:
2024-04-26 03:55:21 +00:00
parent 93f58648ed
commit b71f0054a0
20 changed files with 1221 additions and 0 deletions

View File

@ -0,0 +1,2 @@
from .common import *
from .user import *

8
fuware/schemas/common.py Normal file
View File

@ -0,0 +1,8 @@
from typing import Generic, TypeVar
from pydantic import BaseModel
T = TypeVar('T')
class ReturnValue(BaseModel, Generic[T]):
status: int
data: T

24
fuware/schemas/user.py Normal file
View File

@ -0,0 +1,24 @@
from datetime import datetime
from pydantic import BaseModel
from fastapi import Form
class UserBase(BaseModel):
username: str = Form(...)
class UserRequest(UserBase):
password: str = Form(...)
class UserCreate(UserRequest):
password: str = Form(...)
name: str
class User(UserBase):
id: str
name: str
is_admin: bool
is_lock: bool
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True