mirror of
https://github.com/langgenius/dify.git
synced 2025-12-22 02:35:24 -05:00
refactor: Migrate part of the console basic API module to Flask-RESTX (#24732)
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
from flask_restx import Resource
|
||||
from flask_restx import Resource, fields
|
||||
|
||||
from controllers.console import api
|
||||
from . import api, console_ns
|
||||
|
||||
|
||||
@console_ns.route("/ping")
|
||||
class PingApi(Resource):
|
||||
@api.doc("health_check")
|
||||
@api.doc(description="Health check endpoint for connection testing")
|
||||
@api.response(
|
||||
200,
|
||||
"Success",
|
||||
api.model("PingResponse", {"result": fields.String(description="Health check result", example="pong")}),
|
||||
)
|
||||
def get(self):
|
||||
"""
|
||||
For connection health check
|
||||
"""
|
||||
"""Health check endpoint for connection testing"""
|
||||
return {"result": "pong"}
|
||||
|
||||
|
||||
api.add_resource(PingApi, "/ping")
|
||||
|
||||
Reference in New Issue
Block a user