18 lines
446 B
Python
18 lines
446 B
Python
|
|
import reflex as rx
|
|
from reflex_ipad.models import *
|
|
from sqlmodel import Field, Session, SQLModel, create_engine, select
|
|
import time
|
|
|
|
async def scan(uuid: str):
|
|
print(uuid)
|
|
with rx.session() as session:
|
|
scan = Scan(uuid=uuid, timestamp=time.time())
|
|
session.add(scan)
|
|
session.commit()
|
|
return scan.as_dict()
|
|
|
|
def register_at(app):
|
|
print("register scan")
|
|
app.api.add_api_route("/scan/{uuid}", scan)
|