123456789101112131415161718192021222324252627282930313233343536 |
- """
- @author: luojunhui
- """
- from quart import Blueprint, jsonify, request
- from applications.functions import ParamProcess
- video_score_blueprint = Blueprint('light_gbm_score', __name__)
- @video_score_blueprint.route('/hello')
- async def hello():
- """
- Hello World Test
- :return:
- """
- return jsonify({'message': 'Hello, World!'})
- @video_score_blueprint.route('/lightgbm_score', methods=['POST'])
- async def post_data():
- """
- 请求接口代码
- :return:
- """
- p = ParamProcess()
- data = await request.get_json()
- processed_data = await p.process(data)
- if processed_data:
- obj = processed_data[0]
- else:
- obj = None
- r = {
- 'quality_score': obj
- }
- return jsonify(r)
|