mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 10:39:59 +01:00
41 lines
793 B
Python
41 lines
793 B
Python
from sqlite3 import Row
|
|
|
|
from fastapi.param_functions import Query
|
|
from pydantic import BaseModel
|
|
from typing import Optional
|
|
|
|
|
|
class CreateUserData(BaseModel):
|
|
user_name: str = Query(...)
|
|
wallet_name: str = Query(...)
|
|
admin_id: str = Query(...)
|
|
email: str = Query("")
|
|
password: str = Query("")
|
|
|
|
|
|
class CreateUserWallet(BaseModel):
|
|
user_id: str = Query(...)
|
|
wallet_name: str = Query(...)
|
|
admin_id: str = Query(...)
|
|
|
|
|
|
class Users(BaseModel):
|
|
id: str
|
|
name: str
|
|
admin: str
|
|
email: Optional[str] = None
|
|
password: Optional[str] = None
|
|
|
|
|
|
class Wallets(BaseModel):
|
|
id: str
|
|
admin: str
|
|
name: str
|
|
user: str
|
|
adminkey: str
|
|
inkey: str
|
|
|
|
@classmethod
|
|
def from_row(cls, row: Row) -> "Wallets":
|
|
return cls(**dict(row))
|