初始化demo

This commit is contained in:
杜宇轩
2026-09-11 15:45:13 +08:00
commit fdc58229af
25 changed files with 644 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
from .base import Session, SessionStore
from .json_store import JSONSessionStore
from .sqlite_store import SQLiteSessionStore
__all__ = [
"Session",
"SessionStore",
"JSONSessionStore",
"SQLiteSessionStore",
"get_session_store",
]
def get_session_store() -> SessionStore:
from .. import config
backend = config.SESSION_BACKEND
if backend == "sqlite":
return SQLiteSessionStore(config.SQLITE_PATH)
if backend == "json":
return JSONSessionStore(config.SESSION_DIR)
raise ValueError(f"Unsupported SESSION_BACKEND: {backend}")