123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- """
- @author: luojunhui
- """
- from quart import Blueprint, jsonify, request
- from deal import VideoDeal
- from deal import ArticleMatchAccount
- from deal import ShareCard
- from deal import SingleVideo
- from deal import MatchArticlesV1
- from deal import MatchArticlesV2
- bp = Blueprint('VideosToArticle', __name__)
- def VTARoutes(mysql_client):
- """
- :param mysql_client:
- :return:
- """
- @bp.route("/healthcheck")
- def hello_world():
- """
- Health Check Port
- :return:
- """
- result = {
- "status": "success",
- "msg": "Hello Future"
- }
- return jsonify(result)
- @bp.route('/videos', methods=["POST"])
- async def find_videos():
- """
- 更具接口获取视频信息
- :return:
- """
- params = await request.get_json()
- VD = VideoDeal(params, mysql_client)
- result = await VD.deal()
- return jsonify(result)
- @bp.route("/match", methods=["POST"])
- async def match_account():
- """
- 匹配小程序
- :return:
- """
- params = await request.get_json()
- MA = ArticleMatchAccount(params=params)
- res = MA.deal()
- return jsonify(res)
- @bp.route("/getShareCard", methods=["POST"])
- async def get_share_cards():
- """
- 获取分享卡片
- :return:
- """
- params = await request.get_json()
- SC = ShareCard(params=params)
- response = SC.deal()
- return jsonify(response)
- @bp.route("/singleVideo", methods=["POST"])
- async def find_video_info():
- """
- 获取单个视频的信息
- :return:
- """
- params = await request.get_json()
- SV = SingleVideo(params=params)
- response = SV.deal()
- return jsonify(response)
- @bp.route("/matchArticleV1", methods=["POST"])
- async def match_article():
- """
- 匹配视频
- :return:
- """
- params = await request.get_json()
- MA = MatchArticlesV1(params=params, mysql_client=mysql_client)
- response = await MA.deal()
- return jsonify(response)
- @bp.route("/matchArticleV2", methods=["POST"])
- async def recall_article():
- """
- Recall Article
- """
- params = await request.get_json()
- MA2 = MatchArticlesV2(params=params, mysql_client=mysql_client)
- response = await MA2.deal()
- return jsonify(response)
- return bp
|