endpoints.py 386 B

12345678910111213141516
  1. """通用 API 端点"""
  2. from quart import Blueprint, jsonify
  3. def create_health_bp() -> Blueprint:
  4. """健康检查端点 —— GET /health"""
  5. bp = Blueprint("health", __name__)
  6. @bp.route("/health", methods=["GET"])
  7. async def health():
  8. return jsonify(
  9. {"code": 0, "message": "success", "data": {"message": "hello world"}}
  10. )
  11. return bp