feat: Integrates execution repository inheritance

Signed-off-by: -LAN- <laipz8200@outlook.com>
pull/22581/head
-LAN- 11 months ago
parent 908ea295bc
commit 65cac6affa
No known key found for this signature in database
GPG Key ID: 6BA0D108DED011FF

@ -9,15 +9,15 @@ The service repository handles operations that require access to database-specif
tenant_id, app_id, triggered_from, etc., which are not part of the core domain model. tenant_id, app_id, triggered_from, etc., which are not part of the core domain model.
""" """
from abc import abstractmethod
from collections.abc import Sequence from collections.abc import Sequence
from datetime import datetime from datetime import datetime
from typing import Optional, Protocol from typing import Optional, Protocol
from core.workflow.repositories.workflow_node_execution_repository import WorkflowNodeExecutionRepository
from models.workflow import WorkflowNodeExecutionModel from models.workflow import WorkflowNodeExecutionModel
class DifyAPIWorkflowNodeExecutionRepository(Protocol): class DifyAPIWorkflowNodeExecutionRepository(WorkflowNodeExecutionRepository, Protocol):
""" """
Protocol for service-layer operations on WorkflowNodeExecutionModel. Protocol for service-layer operations on WorkflowNodeExecutionModel.
@ -38,7 +38,6 @@ class DifyAPIWorkflowNodeExecutionRepository(Protocol):
- Supports cleanup and maintenance operations - Supports cleanup and maintenance operations
""" """
@abstractmethod
def get_node_last_execution( def get_node_last_execution(
self, self,
tenant_id: str, tenant_id: str,
@ -63,7 +62,6 @@ class DifyAPIWorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abstractmethod
def get_executions_by_workflow_run( def get_executions_by_workflow_run(
self, self,
tenant_id: str, tenant_id: str,
@ -86,7 +84,6 @@ class DifyAPIWorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abstractmethod
def get_execution_by_id( def get_execution_by_id(
self, self,
execution_id: str, execution_id: str,
@ -107,7 +104,6 @@ class DifyAPIWorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abstractmethod
def delete_expired_executions( def delete_expired_executions(
self, self,
tenant_id: str, tenant_id: str,
@ -130,7 +126,6 @@ class DifyAPIWorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abstractmethod
def delete_executions_by_app( def delete_executions_by_app(
self, self,
tenant_id: str, tenant_id: str,
@ -153,7 +148,6 @@ class DifyAPIWorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abstractmethod
def get_expired_executions_batch( def get_expired_executions_batch(
self, self,
tenant_id: str, tenant_id: str,
@ -176,7 +170,6 @@ class DifyAPIWorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abstractmethod
def delete_executions_by_ids( def delete_executions_by_ids(
self, self,
execution_ids: Sequence[str], execution_ids: Sequence[str],

@ -38,11 +38,12 @@ from collections.abc import Sequence
from datetime import datetime from datetime import datetime
from typing import Optional, Protocol from typing import Optional, Protocol
from core.workflow.repositories.workflow_execution_repository import WorkflowExecutionRepository
from libs.infinite_scroll_pagination import InfiniteScrollPagination from libs.infinite_scroll_pagination import InfiniteScrollPagination
from models.workflow import WorkflowRun from models.workflow import WorkflowRun
class APIWorkflowRunRepository(Protocol): class APIWorkflowRunRepository(WorkflowExecutionRepository, Protocol):
""" """
Protocol for service-layer WorkflowRun repository operations. Protocol for service-layer WorkflowRun repository operations.

Loading…
Cancel
Save