📚 Improved code organization and structure in backend modules 🚧🔧

This commit is contained in:
2025-06-11 14:20:21 +02:00
parent c4bd6ff4dc
commit c386b34d3a
10 changed files with 42 additions and 13 deletions

View File

@@ -38,6 +38,21 @@ class Config:
SESSION_LIFETIME = 3600
MAX_FILE_SIZE = 100 * 1024 * 1024 # 100MB
ALLOWED_EXTENSIONS = ['.gcode', '.stl', '.obj']
UPLOAD_FOLDER = "backend/uploads"
# TAPO Smart Plug Configuration
TAPO_USERNAME = "till.tomczak@mercedes-benz.com"
TAPO_PASSWORD = "744563017196A"
DEFAULT_TAPO_IPS = [
"192.168.0.103",
"192.168.0.104",
"192.168.0.100",
"192.168.0.101",
"192.168.0.102",
"192.168.0.105"
]
TAPO_TIMEOUT = 10
TAPO_RETRY_COUNT = 3
@classmethod
def get_all(cls) -> Dict[str, Any]:
@@ -215,6 +230,20 @@ def get_system_status() -> Dict[str, Any]:
DATABASE_PATH = Config.DATABASE_PATH
SECRET_KEY = Config.SECRET_KEY
SESSION_LIFETIME = Config.SESSION_LIFETIME
UPLOAD_FOLDER = Config.UPLOAD_FOLDER
ALLOWED_EXTENSIONS = Config.ALLOWED_EXTENSIONS
MAX_FILE_SIZE = Config.MAX_FILE_SIZE
TAPO_USERNAME = Config.TAPO_USERNAME
TAPO_PASSWORD = Config.TAPO_PASSWORD
DEFAULT_TAPO_IPS = Config.DEFAULT_TAPO_IPS
TAPO_TIMEOUT = Config.TAPO_TIMEOUT
TAPO_RETRY_COUNT = Config.TAPO_RETRY_COUNT
def ensure_database_directory():
"""Erstellt das Datenbank-Verzeichnis."""
db_dir = os.path.dirname(DATABASE_PATH)
if db_dir:
os.makedirs(db_dir, exist_ok=True)
def send_email(recipient, subject, message):
return email_notification.send_notification(recipient, subject, message)