title_routes.py 588 B

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