def verify(self, sql_verify, rv): if sql_verify: obj = MysqlDb(app.config['DBNAME']) verify = getattr(obj, sql_verify)() if not verify: rv.update(dict(status=False, msg="数据库校验不正确!请检查!")) del obj
def prepare(self, sql, case): if sql: obj = MysqlDb(app.config['DBNAME']) value = getattr(obj, sql)() pre_data = case.get('pre_data') params = json.loads(case.get('params')) requestData = params.get('requestData') requestData.update({pre_data: value}) params.update(dict(requestData=requestData)) case.update(dict(params=dumps(params))) del obj
def delUser(mobile="18516600716"): rt = {'status': False} db = MysqlDb(app.config['DBNAME']) rt.update(dict(status=db.delete_user(mobile))) return jsonify(rt)
def clean(self, sql_clean): if sql_clean: obj = MysqlDb(app.config['DBNAME']) getattr(obj, sql_clean)() del obj
def getVerify(mobile="18516600716"): rt = {'code': None} db = MysqlDb(app.config['DBNAME']) rt.update(dict(code=db.getVerifyCode(mobile))) return jsonify(rt)