Refactor app helpers and use AppStateDep in config router

Move service-dependent helper wrappers from app.utils to app.helpers and update config router activation/rollback to use explicit AppState dependency.
This commit is contained in:
2026-04-07 20:39:56 +02:00
parent ed3aa61c35
commit 1e39e5a1d6
11 changed files with 98 additions and 30 deletions

View File

@@ -0,0 +1,21 @@
"""Shared log-related helpers for service-layer code."""
from __future__ import annotations
from typing import TYPE_CHECKING
from app.services.log_service import preview_log as _preview_log
from app.services.log_service import test_regex as _test_regex
if TYPE_CHECKING:
from app.models.config import LogPreviewRequest, LogPreviewResponse, RegexTestRequest, RegexTestResponse
def preview_log(req: LogPreviewRequest) -> LogPreviewResponse:
"""Return log preview results using the shared log service."""
return _preview_log(req)
def test_regex(req: RegexTestRequest) -> RegexTestResponse:
"""Validate a regex pattern using the shared log service."""
return _test_regex(req)