dify/api/controllers/web/feature.py

22 lines
766 B
Python
Raw Normal View History

from flask_restx import Resource
2024-05-15 16:14:49 +08:00
from controllers.web import web_ns
2024-05-15 16:14:49 +08:00
from services.feature_service import FeatureService
@web_ns.route("/system-features")
2024-05-15 16:14:49 +08:00
class SystemFeatureApi(Resource):
@web_ns.doc("get_system_features")
@web_ns.doc(description="Get system feature flags and configuration")
@web_ns.doc(responses={200: "System features retrieved successfully", 500: "Internal server error"})
2024-05-15 16:14:49 +08:00
def get(self):
"""Get system feature flags and configuration.
2024-05-15 16:14:49 +08:00
Returns the current system feature flags and configuration
that control various functionalities across the platform.
2024-05-15 16:14:49 +08:00
Returns:
dict: System feature configuration object
"""
return FeatureService.get_system_features().model_dump()