123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- """
- @author: luojunhui
- """
- from quart import Blueprint, jsonify, request
- from server.api import Response, Record, Minigram, GetOffVideos
- my_blueprint = Blueprint('LongArticlesMatchServer', __name__)
- def Routes(mysql_client, config):
- """
- 路由代码
- """
- @my_blueprint.route('/healthcheck')
- def healthcheck():
- """
- Hello World Test
- :return:
- """
- return jsonify({'message': 'Hello, World!'})
- @my_blueprint.route('/search_videos', methods=['POST'])
- async def search_videos_from_the_web():
- """
- record Data
- :return:
- """
- params = await request.get_json()
- record = Record(params=params, mysql_client=mysql_client, config=config)
- result = await record.deal()
- return jsonify(result)
- @my_blueprint.route('/recall_videos', methods=['POST'])
- async def recall_results():
- """
- 获取视频分享卡片
- :return:
- """
- data = await request.get_json()
- response = Response(
- params=data,
- mysql_client=mysql_client,
- config=config
- )
- result = await response.deal()
- return jsonify(result)
- @my_blueprint.route("/choose_minigram", methods=['POST'])
- async def match_minigram():
- """
- 获取小程序信息
- :return:
- """
- data = await request.get_json()
- mini_program = Minigram(params=data, config=config)
- result = await mini_program.deal()
- return jsonify(result)
- @my_blueprint.route("/get_off_videos", methods=['POST'])
- async def get_off_videos():
- """
- 自动下架视频记录
- :return:
- """
- data = await request.get_json()
- get_off_video = GetOffVideos(params=data, mysql_client=mysql_client, config=config)
- result = await get_off_video.deal()
- return jsonify(result)
- return my_blueprint
|