mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor: 推进后端分层架构治理
This commit is contained in:
@@ -3,7 +3,9 @@ from typing import Any, Union
|
||||
|
||||
from app.chain import ChainBase
|
||||
from app.db.oper.systemconfig import SystemConfigOper
|
||||
from app.schemas import ActionContext, ActionParams, ActionResult
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionResult
|
||||
|
||||
|
||||
class ActionChain(ChainBase):
|
||||
|
||||
@@ -8,7 +8,10 @@ from app.chain.media import MediaChain
|
||||
from app.runtime.config import global_vars
|
||||
from app.domain.metainfo import MetaInfo
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext, DownloadTask, MediaType
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.schemas.workflow import DownloadTask
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
|
||||
class AddDownloadParams(ActionParams):
|
||||
|
||||
@@ -4,7 +4,8 @@ from app.runtime.config import settings, global_vars
|
||||
from app.domain.context import MediaInfo
|
||||
from app.db.oper.subscribe import SubscribeOper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
|
||||
|
||||
class AddSubscribeParams(ActionParams):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from app.workflow.actions import BaseAction, ActionChain
|
||||
from app.runtime.config import global_vars
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.runtime.log import logger
|
||||
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.chain.recommend import RecommendChain
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.runtime.config import settings, global_vars
|
||||
from app.runtime.events import eventmanager
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import RecommendSourceEventData, MediaInfo
|
||||
from app.schemas.event import RecommendSourceEventData
|
||||
from app.schemas.workflow import MediaInfo
|
||||
from app.schemas.types import ChainEventType
|
||||
from app.adapters.network.http import RequestUtils
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ from app.domain.context import Context, TorrentInfo
|
||||
from app.domain.metainfo import MetaInfo
|
||||
from app.application.rss import RssHelper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
|
||||
|
||||
class FetchRssParams(ActionParams):
|
||||
|
||||
@@ -9,7 +9,9 @@ from app.chain.media import MediaChain
|
||||
from app.chain.search import SearchChain
|
||||
from app.runtime.config import global_vars
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext, MediaType
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
|
||||
class FetchTorrentsParams(ActionParams):
|
||||
|
||||
@@ -5,7 +5,8 @@ from pydantic import Field
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.runtime.config import global_vars
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
|
||||
|
||||
class FilterMediasParams(ActionParams):
|
||||
|
||||
@@ -6,7 +6,8 @@ from app.workflow.actions import BaseAction, ActionChain
|
||||
from app.runtime.config import global_vars
|
||||
from app.application.torrent import TorrentHelper
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
|
||||
|
||||
class FilterTorrentsParams(ActionParams):
|
||||
|
||||
@@ -3,7 +3,8 @@ from pydantic import Field
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.runtime.extensions.plugin_manager import PluginManager
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
|
||||
|
||||
class InvokePluginParams(ActionParams):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.schemas import ActionContext
|
||||
from app.schemas.workflow import ActionContext
|
||||
|
||||
|
||||
class NoteAction(BaseAction):
|
||||
|
||||
@@ -7,7 +7,8 @@ from app.workflow.actions import BaseAction
|
||||
from app.chain.storage import StorageChain
|
||||
from app.runtime.config import global_vars, settings
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
|
||||
|
||||
class ScanFileParams(ActionParams):
|
||||
|
||||
@@ -3,7 +3,8 @@ from app.chain.scraping import ScrapingChain
|
||||
from app.chain.storage import StorageChain
|
||||
from app.runtime.config import global_vars
|
||||
from app.runtime.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.workflow.actions import BaseAction
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.runtime.events import eventmanager
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.schemas.types import ChainEventType
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@ from typing import List, Optional, Union
|
||||
from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction, ActionChain
|
||||
from app.schemas import ActionParams, ActionContext, Message
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.schemas.message import Message
|
||||
from app.runtime.config import settings
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ from pydantic import Field
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.runtime.config import global_vars
|
||||
from app.db.oper.transferhistory import TransferHistoryOper
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.workflow import ActionParams
|
||||
from app.schemas.workflow import ActionContext
|
||||
from app.chain.storage import StorageChain
|
||||
from app.chain.transfer import TransferChain
|
||||
from app.runtime.log import logger
|
||||
|
||||
Reference in New Issue
Block a user