mirror of
https://github.com/langgenius/dify.git
synced 2026-01-07 14:58:32 +00:00
Proof-of-concept: Resource to MethodView conversion research
Co-authored-by: asukaminato0721 <30024051+asukaminato0721@users.noreply.github.com>
This commit is contained in:
@@ -36,6 +36,9 @@ from .dataset import (
|
||||
)
|
||||
from .workspace import models
|
||||
|
||||
# Register MethodView classes with the blueprint
|
||||
bp.add_url_rule("/", view_func=index.IndexApi.as_view("index_api"), methods=["GET"])
|
||||
|
||||
__all__ = [
|
||||
"annotation",
|
||||
"app",
|
||||
@@ -56,4 +59,5 @@ __all__ = [
|
||||
"workflow",
|
||||
]
|
||||
|
||||
api.add_namespace(service_api_ns)
|
||||
# Temporarily disable namespace registration to test MethodView
|
||||
# api.add_namespace(service_api_ns)
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
from flask_restx import Resource
|
||||
from flask.views import MethodView
|
||||
|
||||
from configs import dify_config
|
||||
from controllers.service_api import service_api_ns
|
||||
|
||||
|
||||
@service_api_ns.route("/")
|
||||
class IndexApi(Resource):
|
||||
class IndexApi(MethodView):
|
||||
def get(self):
|
||||
return {
|
||||
"welcome": "Dify OpenAPI",
|
||||
|
||||
Reference in New Issue
Block a user