mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-06-06 16:14:40 +08:00
refactor: imports and reorganize domain structure
- Updated import statements across multiple modules to use relative imports for better encapsulation. - Consolidated and organized the `__init__.py` files in various domain packages to expose necessary classes and functions. - Improved code readability and maintainability by grouping related imports and removing unused ones. - Ensured consistent import patterns across the domain, enhancing the overall structure of the codebase.
This commit is contained in:
8
main.py
8
main.py
@@ -2,8 +2,8 @@ import os
|
||||
from pathlib import Path
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from domain.config.service import ConfigService, VERSION
|
||||
from domain.adapters.registry import runtime_registry
|
||||
from domain.adapters import runtime_registry
|
||||
from domain.config import ConfigService, VERSION
|
||||
from db.session import close_db, init_db
|
||||
from api.routers import include_routers
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
@@ -19,7 +19,7 @@ from middleware.exception_handler import (
|
||||
)
|
||||
import httpx
|
||||
from dotenv import load_dotenv
|
||||
from domain.tasks.task_queue import task_queue_service
|
||||
from domain.tasks import task_queue_service
|
||||
|
||||
load_dotenv()
|
||||
|
||||
@@ -59,7 +59,7 @@ async def lifespan(app: FastAPI):
|
||||
await task_queue_service.start_worker()
|
||||
|
||||
# 加载已安装的插件
|
||||
from domain.plugins.startup import init_plugins
|
||||
from domain.plugins import init_plugins
|
||||
await init_plugins(app)
|
||||
|
||||
# 在所有路由加载完成后,挂载静态文件服务(放在最后以避免覆盖 API 路由)
|
||||
|
||||
Reference in New Issue
Block a user