mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-26 07:31:22 +01:00
Squashed 9 commits: * Added Discordbot Extension * Removed backup files * Fixing renaming wallet * added further description * further description index.html * import staticfiles * remove duplicate file * deleted changes in core
36 lines
719 B
Python
36 lines
719 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(...)
|
|
discord_id: 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
|
|
discord_id: str
|
|
|
|
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))
|