__init__.py 697 B

1234567891011121314151617181920212223242526272829303132333435
  1. """
  2. @author: luojunhui
  3. 投流--路由
  4. """
  5. from quart import Blueprint, jsonify, request
  6. from config import env
  7. TL_blueprint = Blueprint("TouLiu", __name__)
  8. def Routes(db_client):
  9. """
  10. 路由代码
  11. :param db_client: 异步db连接池
  12. :return:
  13. """
  14. @TL_blueprint.route("/hello")
  15. def helloWorld():
  16. """
  17. :return: Hello World
  18. """
  19. return jsonify({"message": "Hello World!"})
  20. @TL_blueprint.route("/generateInfo", methods=['POST'])
  21. async def generateInfo():
  22. """
  23. 生成一些需要用到到信息
  24. :return:
  25. """
  26. return jsonify({"message": "this function is developing"})
  27. return TL_blueprint