1234567891011121314151617181920212223242526272829303132 |
- # -*- encoding: utf-8 -*-
- '''
- @File : main.py
- @Time : 2024/08/29 15:47:26
- @Author : Zhangziheng
- '''
- from flask import Blueprint, request, jsonify
- from ..utils.conf_spider import wangye_name
- api_blueprint = Blueprint('mainRoute', __name__, url_prefix='/')
- @api_blueprint.route("/")
- def shouye():
- return f"欢迎访问{wangye_name}!"
- @api_blueprint.route("/data/add", methods=['POST'])
- def add_data():
- req_json = request.json
- page_index = req_json.get("pageDeep")
- # 爬虫的具体功能
- item = {
- "code": 200,
- "msg": "success",
- "data": []
- }
- return jsonify(item)
|