def insert_data(): temp_range = [i for i in range(0, 110)] from random import choice for i in range(1): payload = { 'method': 'insert', 'payload': { 'temperature': choice(temp_range), 'city': 'Pune' } } resp = TempTracker().controller(**payload) print(resp)
def temperature_get_mean(): """ Temperature to get minimum temperature from database :return: """ response = {} if request.method == 'GET': response = TempTracker().controller(**{ 'method': 'get_mean', 'payload': {}, 'response': 'flask_resp' }) return jsonify(**response)
def temperature(): """ Temperature API for POST, GET, PUT, DELETE :return: """ response = {} print('test') if request.method == 'POST': payload = jsonify_request(request) response = TempTracker().controller(**{ 'method': 'insert', 'payload': payload, 'response': 'flask_resp' }) return jsonify(**response)
def get_mean(): payload = {'method': 'get_mean'} resp = TempTracker().controller(**payload) print(resp)
def get_max(): payload = {'method': 'get_max', 'response': 'flask_resp'} resp = TempTracker().controller(**payload) print(resp)