dify/api/controllers/console/feature.py

25 lines
657 B
Python
Raw Normal View History

from flask_login import current_user
from flask_restful import Resource
2024-04-18 17:33:32 +08:00
from services.enterprise.enterprise_feature_service import EnterpriseFeatureService
from services.feature_service import FeatureService
from . import api
from .wraps import cloud_utm_record
class FeatureApi(Resource):
@cloud_utm_record
def get(self):
return FeatureService.get_features(current_user.current_tenant_id).dict()
2024-04-18 17:33:32 +08:00
class EnterpriseFeatureApi(Resource):
def get(self):
return EnterpriseFeatureService.get_enterprise_features().dict()
api.add_resource(FeatureApi, '/features')
2024-04-18 17:33:32 +08:00
api.add_resource(EnterpriseFeatureApi, '/enterprise-features')