feat: 接通 Planner → Action → Validator
This commit is contained in:
+2
-2
@@ -3,10 +3,10 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Generic, TypeVar
|
||||
|
||||
from app.schemas.actions import BaseAction
|
||||
from app.schemas.actions.base import ActionModel
|
||||
from app.schemas.screen import Screen, ScreenNode
|
||||
|
||||
ActionT = TypeVar("ActionT", bound=BaseAction)
|
||||
ActionT = TypeVar("ActionT", bound=ActionModel)
|
||||
|
||||
|
||||
class BaseActionHandler(ABC, Generic[ActionT]):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
from app.actions.add import AddHandler
|
||||
from app.actions.base import BaseActionHandler
|
||||
from app.actions.move import MoveHandler
|
||||
from app.actions.resize import ResizeHandler
|
||||
@@ -11,6 +12,7 @@ from app.schemas.screen import Screen
|
||||
|
||||
# 新增操作时在此注册,未实现的操作明确报错
|
||||
ACTION_HANDLERS: dict[str, BaseActionHandler[Any]] = {
|
||||
"add": AddHandler(),
|
||||
"move": MoveHandler(),
|
||||
"resize": ResizeHandler(),
|
||||
"update": UpdateHandler(),
|
||||
|
||||
Reference in New Issue
Block a user