Beispiel #1
0
def get_c1_data():
    data = utils.get_c1_data()
    return jsonify({
        "confirm": data[0],
        "suspect": data[1],
        "heal": data[2],
        "dead": data[3]
    })
Beispiel #2
0
def get_c1_data():
    data = utils.get_c1_data()
    return jsonify({
        "confirm": int(data[0]),
        "suspect": int(data[1]),
        "heal": int(data[2]),
        "dead": int(data[3])
    })
Beispiel #3
0
def get_c1_data():
    data = utils.get_c1_data()
    return jsonify({
        'confirm': data[0],
        'suspect': data[1],
        'heal': data[2],
        'dead': data[3]
    })
Beispiel #4
0
def g_c1():
    temp = get_c1_data()
    return jsonify({
        'confirm': temp[0],
        'suspect': temp[1],
        'heal': temp[2],
        'dead': temp[3]
    })  #前端由ajax负责加载数据
Beispiel #5
0
def get_c1_data():
    data = utils.get_c1_data()
    return jsonify({
        "confirm": data[0],
        "exist": data[1],
        "recover": data[2],
        "death": data[3]
    })
Beispiel #6
0
def get_lw_data():
    res = []
    for tup in utils.get_lw_data():
        res.append({"name": tup[0], "value": int(tup[1])})
    china = utils.get_c1_data()
    res.append({"name": "中国", "value": int(china[0])})
    # print(china)
    # print(res)
    return jsonify({"data": res})
Beispiel #7
0
def get_c1_data():
    data = utils.get_c1_data()
    result = jsonify({
        "confirm": str(Decimal(data[0])),
        "suspect": str(Decimal(data[1])),
        "heal": str(Decimal(data[2])),
        "dead": str(Decimal(data[3]))
    })
    return result
Beispiel #8
0
def get_c1_data():
    data = utils.get_c1_data()
    brand = []
    num = []
    for k, v in data:
        brand.append(k)
        num.append(int(v))
    print(brand)
    return jsonify({"brand": brand, "price": num})
Beispiel #9
0
def get_world():
    res = []
    global_dict = utils.get_world()
    for tup in global_dict:
        res.append({'name': tup, 'value': global_dict[tup]})
    # 获取中国累计确诊人数
    china_data = utils.get_c1_data()[0]
    res.append({'name': '中国', 'value': int(china_data)})
    return jsonify({'data': res, 'name': nameMap.namemap})
Beispiel #10
0
def get_c1_data():
    data = utils.get_c1_data()
    content = {
        "confirm": str(data[0]),
        "suspect": str(data[1]),
        "heal": str(data[2]),
        "dead": str(data[3])
    }
    return jsonify(content)
Beispiel #11
0
def get_c1_data():
    data = utils.get_c1_data()
    return jsonify({
        'confirm': data[1],
        'heal': data[2],
        'dead': data[3],
        'nowConfirm': data[4],
        'suspect': data[5],
        'nowSevere': data[6]
    })
Beispiel #12
0
def get_c1_data():
    data = utils.get_c1_data()
    return jsonify({
        "confirm": data[0],
        "import_case": data[1],
        "heal": data[2],
        "dead": data[3],
        "suspect": data[4],
        "heal_rate": data[5],
        "dead_rate": data[6]
    })
Beispiel #13
0
def get_c1_data():
    data = utils.get_c1_data()
    # print(data[0])
    res = jsonify({
        "confirm": data[0],
        "suspect": data[1],
        "heal": data[2],
        "dead": data[3],
        "importedCase": data[4]
    })
    # print(res)
    return res
Beispiel #14
0
def get_c1_data():
    data = utils.get_c1_data()
    data = [data[0].to_eng_string(), data[1], data[2].to_eng_string(), data[3].to_eng_string()]
    return jsonify({"confirm":data[0],"suspect":data[1],"heal":data[2],"dead":data[3]})
Beispiel #15
0
def get_c1_data():
    data = utils.get_c1_data()
    # 返回给前端的时候要注意了,要么返回普通的字符串,要么返回json字符串
    return jsonify({"confirm":data[0],"suspect":data[1],"heal":data[2],"dead":data[3]})