Python之mock接口开发
import flask import json import pymysql import tools #mock接口开发 #1.模拟接口的意思 #2.给别人提供数据 #3.flask是一个web开发框架 server=flask.Flask(__name__) # @server.route('/api/login',methods=['post','get']) # def login(): # username=flask.request.values.get('username') # password = flask.request.values.get('password') # d={'error_code':1,'msg':'登陆成功','username':username,'password':password} # return json.dump(d,ensure_ascii=False) @server.route('api/get_bill') def get_bill(): table_list=['app_myuser','czm'] table_name=flask.request.values.get('table_name') limit=flask.request.values.get('limit',50) if table_name