Files
dify/api/services/feature_service_gateway.py
林玮 (Jade Lin) 70a513fc62 fix(api): scope hosted credits by tenant plan (#41131)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-24 06:35:42 +00:00

37 lines
1.1 KiB
Python

"""Feature-query gateway backed by the existing FeatureService."""
from typing import override
from services.entities.feature_entities import (
FeatureModel,
LicenseModel,
SystemFeatureModel,
VectorSpaceLimitationModel,
)
from services.feature_query_service import FeatureQueryGateway
from services.feature_service import FeatureService
class FeatureServiceGateway(FeatureQueryGateway):
"""Read dynamic feature resources through FeatureService."""
@override
def get_workspace_features(self, workspace_id: str) -> FeatureModel:
return FeatureService.get_features(workspace_id, exclude_vector_space=True)
@override
def get_trial_models(self, workspace_id: str) -> list[str]:
return FeatureService.get_trial_models(workspace_id)
@override
def get_vector_space(self, workspace_id: str) -> VectorSpaceLimitationModel:
return FeatureService.get_vector_space(workspace_id)
@override
def get_public_system_features(self) -> SystemFeatureModel:
return FeatureService.get_system_features()
@override
def get_license(self) -> LicenseModel:
return FeatureService.get_license()