123456789101112131415161718192021222324252627282930313233343536373839404142 |
- """
- encoding: UTF-8
- @author:clx
- @file:model.py
- @time:2023/5/30 6:29
- """
- from typing import Optional, Union
- from pydantic import BaseModel
- class Item(BaseModel):
- id: int
- name: str
- class Token(BaseModel):
- access_token: str
- token_type: str
- class TokenData(BaseModel):
- username: Union[str, None] = None
- class User(BaseModel):
- username: str
- email: Union[str, None] = None
- full_name: Union[str, None] = None
- disabled: Union[bool, None] = None
- class UserInDB(User):
- hashed_password: str
- fake_users_db = {
- "clx": {
- "username": "clx",
- "full_name": "Lixu Cao",
- "email": "clx@example.com",
- "hashed_password": "$2b$12$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW",
- "disabled": False,
- }
- }
|