routes.py 604 B

12345678910111213141516171819202122232425262728
  1. """
  2. @author: luojunhui
  3. """
  4. from quart import Blueprint, jsonify, request
  5. from applications.functions import process_data
  6. video_score_blueprint = Blueprint('light_gbm_score', __name__)
  7. @video_score_blueprint.route('/hello')
  8. async def hello():
  9. """
  10. Hello World Test
  11. :return:
  12. """
  13. return jsonify({'message': 'Hello, World!'})
  14. @video_score_blueprint.route('/lightgbm_score', methods=['POST'])
  15. async def post_data():
  16. """
  17. 请求接口代码
  18. :return:
  19. """
  20. data = await request.get_json()
  21. processed_data = await process_data(data)
  22. return jsonify(processed_data)