from flask import Flask,request from mysql_search_utils import mysqlSearchUtils from HttpUtils import httpUtils import json app = Flask(__name__) mysql = mysqlSearchUtils() httpUtils = httpUtils() @app.route('/hello') def helloWord(): print(request.path) print(request.full_path) return 'hello world' @app.route('/getOne') def getJson(): responseDict = {} data = mysql.get_one() responseDict["data"] = data return responseDict @app.route('/getList') def getList(): responseDict = {} list = mysql.get_all() responseDict["list"] = list return responseDict @app.route('/testReport') def testReport(): rest = httpUtils.get("http://localhost:8079/getOne",{"accountId":"123"},{"accountId":"123"}) return json.loads(rest) if __name__ == '__main__': app.run(host='0.0.0.0',port=8079,debug=True)