refactor backend module architecture

This commit is contained in:
jxxghp
2026-08-14 15:45:38 +08:00
parent 557cc0e2e3
commit 7b3444c366
716 changed files with 10378 additions and 7709 deletions
+4 -4
View File
@@ -5,11 +5,11 @@ from typing import Optional, List, Dict, Tuple, Callable, Union
from tqdm import tqdm
from app import schemas
from app.helper.progress import ProgressHelper
from app.helper.storage import StorageHelper
from app.log import logger
from app.platform.progress import ProgressHelper
from app.services.storage import StorageHelper
from app.platform.log import logger
from app.schemas.exception import StorageQueryError
from app.utils.crypto import HashUtils
from app.foundation.crypto import HashUtils
def transfer_process(path: str) -> Callable[[int | float], None]:
+5 -5
View File
@@ -9,15 +9,15 @@ from typing import List, Optional, Tuple, Union
import requests
from app import schemas
from app.core.config import settings, global_vars
from app.log import logger
from app.platform.config import settings, global_vars
from app.platform.log import logger
from app.modules.filemanager import StorageBase
from app.modules.filemanager.storages import transfer_process
from app.schemas.exception import StorageQueryError
from app.schemas.types import StorageSchema
from app.utils.http import RequestUtils
from app.utils.singleton import WeakSingleton
from app.utils.string import StringUtils
from app.foundation.http import RequestUtils
from app.foundation.singleton import WeakSingleton
from app.domain.string import StringUtils
lock = threading.Lock()
+6 -6
View File
@@ -6,15 +6,15 @@ from pathlib import Path
from typing import Optional, List
from app import schemas
from app.core.cache import cached
from app.core.config import settings, global_vars
from app.log import logger
from app.platform.cache import cached
from app.platform.config import settings, global_vars
from app.platform.log import logger
from app.modules.filemanager.storages import StorageBase, transfer_process
from app.schemas.exception import OperationInterrupted, StorageQueryError
from app.schemas.types import StorageSchema
from app.utils.http import RequestUtils
from app.utils.singleton import WeakSingleton
from app.utils.url import UrlUtils
from app.foundation.http import RequestUtils
from app.foundation.singleton import WeakSingleton
from app.foundation.url import UrlUtils
# OpenList/AList 在 per_page<=0 时会退回后端默认 200,显式指定最大页大小避免大目录被截断。
+4 -4
View File
@@ -5,14 +5,14 @@ from pathlib import Path
from typing import Optional, List
from app import schemas
from app.core.config import global_vars, settings
from app.helper.directory import DirectoryHelper
from app.log import logger
from app.platform.config import global_vars, settings
from app.services.directory import DirectoryHelper
from app.platform.log import logger
from app.modules.filemanager.fsproxy import fsproxy
from app.modules.filemanager.storages import StorageBase, transfer_process
from app.schemas.exception import StorageQueryError
from app.schemas.types import StorageSchema
from app.utils.system import SystemUtils
from app.infrastructure.system import SystemUtils
class LocalStorage(StorageBase):
+4 -4
View File
@@ -7,13 +7,13 @@ from pathlib import Path
from typing import Optional, List, Union
from app import schemas
from app.core.config import settings
from app.log import logger
from app.platform.config import settings
from app.platform.log import logger
from app.modules.filemanager.storages import StorageBase, transfer_process
from app.schemas.exception import StorageQueryError
from app.schemas.types import StorageSchema
from app.utils.string import StringUtils
from app.utils.system import SystemUtils
from app.domain.string import StringUtils
from app.infrastructure.system import SystemUtils
_MAX_FOLDER_LOCKS = 4096
_folder_locks: OrderedDict[str, threading.Lock] = OrderedDict()
+3 -3
View File
@@ -13,13 +13,13 @@ from smbprotocol.exceptions import (
)
from app import schemas
from app.core.config import settings, global_vars
from app.log import logger
from app.platform.config import settings, global_vars
from app.platform.log import logger
from app.modules.filemanager import StorageBase
from app.modules.filemanager.storages import transfer_process
from app.schemas.exception import StorageQueryError
from app.schemas.types import StorageSchema
from app.utils.singleton import WeakSingleton
from app.foundation.singleton import WeakSingleton
lock = threading.Lock()
+5 -5
View File
@@ -13,15 +13,15 @@ from oss2.models import PartInfo
from cryptography.hazmat.primitives import hashes
from app import schemas
from app.core.config import settings, global_vars
from app.log import logger
from app.platform.config import settings, global_vars
from app.platform.log import logger
from app.modules.filemanager import StorageBase
from app.modules.filemanager.storages import transfer_process
from app.schemas.exception import StorageQueryError
from app.schemas.types import StorageSchema
from app.utils.singleton import WeakSingleton
from app.utils.string import StringUtils
from app.utils.limit import QpsRateLimiter, RateStats
from app.foundation.singleton import WeakSingleton
from app.domain.string import StringUtils
from app.platform.rate import QpsRateLimiter, RateStats
lock = Lock()