routes.py 630 B

1234567891011121314151617181920212223242526272829
  1. """
  2. @author: luojunhui
  3. """
  4. from quart import Blueprint, jsonify, request
  5. from applications.functions import ParamProcess
  6. video_score_blueprint = Blueprint('light_gbm_score', __name__)
  7. @video_score_blueprint.route('/healthcheck')
  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. p = ParamProcess()
  21. data = await request.get_json()
  22. processed_data = await p.process(data)
  23. return jsonify(processed_data)