mirror of
https://github.com/BluemediaDev/ScanOS.git
synced 2025-06-07 05:13:13 +02:00
Initial commit
This commit is contained in:
commit
b9d5c06956
55 changed files with 4706 additions and 0 deletions
0
backend/app/data/__init__.py
Normal file
0
backend/app/data/__init__.py
Normal file
12
backend/app/data/database.py
Normal file
12
backend/app/data/database.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
SQLALCHEMY_DATABASE_URL = "sqlite:///./scanner.db"
|
||||
|
||||
engine = create_engine(
|
||||
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
|
||||
)
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
Base = declarative_base()
|
1
backend/app/data/models.py
Normal file
1
backend/app/data/models.py
Normal file
|
@ -0,0 +1 @@
|
|||
from .database import Base
|
13
backend/app/data/schemas.py
Normal file
13
backend/app/data/schemas.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from pydantic import BaseModel
|
||||
import app.scanner.enums as scan
|
||||
|
||||
class ScanPage(BaseModel):
|
||||
filename: str
|
||||
size_bytes: int
|
||||
|
||||
class Config():
|
||||
orm_mode = True
|
||||
|
||||
class ScanStatus(BaseModel):
|
||||
pages: list[ScanPage]
|
||||
status: scan.Status
|
Loading…
Add table
Add a link
Reference in a new issue