mirror of https://github.com/langgenius/dify.git
Complete Resource to MethodView migration feasibility study
Co-authored-by: asukaminato0721 <30024051+asukaminato0721@users.noreply.github.com>
This commit is contained in:
parent
5a9045cd63
commit
c8002460ac
|
|
@ -36,9 +36,6 @@ 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",
|
||||
|
|
@ -59,5 +56,4 @@ __all__ = [
|
|||
"workflow",
|
||||
]
|
||||
|
||||
# Temporarily disable namespace registration to test MethodView
|
||||
# api.add_namespace(service_api_ns)
|
||||
api.add_namespace(service_api_ns)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
from flask.views import MethodView
|
||||
from flask_restx import Resource
|
||||
|
||||
from configs import dify_config
|
||||
from controllers.service_api import service_api_ns
|
||||
|
||||
|
||||
class IndexApi(MethodView):
|
||||
@service_api_ns.route("/")
|
||||
class IndexApi(Resource):
|
||||
def get(self):
|
||||
return {
|
||||
"welcome": "Dify OpenAPI",
|
||||
|
|
|
|||
Loading…
Reference in New Issue