main.py 635 B

1234567891011121314151617181920212223242526272829303132
  1. # -*- encoding: utf-8 -*-
  2. '''
  3. @File : main.py
  4. @Time : 2024/08/29 15:47:26
  5. @Author : Zhangziheng
  6. '''
  7. from flask import Blueprint, request, jsonify
  8. from ..utils.conf_spider import wangye_name
  9. api_blueprint = Blueprint('mainRoute', __name__, url_prefix='/')
  10. @api_blueprint.route("/")
  11. def shouye():
  12. return f"欢迎访问{wangye_name}!"
  13. @api_blueprint.route("/data/add", methods=['POST'])
  14. def add_data():
  15. req_json = request.json
  16. page_index = req_json.get("pageDeep")
  17. # 爬虫的具体功能
  18. item = {
  19. "code": 200,
  20. "msg": "success",
  21. "data": []
  22. }
  23. return jsonify(item)