def createInvoice_route(): print("request @createInvoice arrived...") content = request.get_json() response = {} if (vc.validateRequest(content) and ua.userIsAuthorized(content, 'createInvoice')): response = Main.createInvoice(content) if ('error' in content): response['error'] = content['error'] return json.dumps(response, default=str) return json.dumps(response, default=str)
def getQuote_route(): print("request @getQuote arrived...") content = request.get_json() response = {} if (vc.validateRequest(content) and ua.userIsAuthorized(content, 'getQuote')): response = Main.getQuote(content) if ('error' in content): response['error'] = content['error'] return json.dumps(response) return json.dumps(response)
def processOrder_route(): print("request @processOrder arrived...") content = request.get_json() response = {} if (vc.validateRequest(content) and ua.userIsAuthorized(content, 'processOrder')): response = Main.processOrder(content) if ('error' in content): response['error'] = content['error'] return json.dumps(response, default=str) return json.dumps(response, default=str)
def registerUser_route(): print("request @registerUser arrived...") content = request.get_json() response = {} if(vc.validateRequest(content)): response = Main.registerUser(content) if('error' in content): response['error'] = content['error'] return json.dumps(response) return json.dumps(response)
def login_route(): print("request @login arrived...") content = request.get_json() #replace user with content response = {} if(vc.validateRequest(content)): response = Main.login(content) if('error' in content): response['error'] = content['error'] return json.dumps(response) return json.dumps(response)
def getAllTransactionHistory_route(): print("request @getAllTransactionHistory arrived...") content = request.get_json() response = {} if (vc.validateRequest(content) and ua.userIsAuthorized(content, 'getAllTransactionHistory')): response = Main.getAllTransactionHistory(content) if ('error' in content): response['error'] = content['error'] return json.dumps(response, default=str) return json.dumps(response, default=str)
# all SQL commands (split on ';') sqlCommands = sqlFile.split(';') for command in sqlCommands: try: db.run(command) print('command executed') except: print('command failed') executeScriptsFromFile('test/no.sql') print('************************************************') """~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""" input = {} output = Main.login(input) print(output) print('#######') input = {'username': '******', 'password': '******'} output = Main.login(input) print(output) print('#######') input = {'username': '******', 'password': '******'} output = Main.login(input) print(output)