예제 #1
0
파일: app.py 프로젝트: shakthydoss/geopush
def ping():
    data = request.json
    data['@timestamp']=getcts()
    #find city by lan and lon
    location = 'chennai'
    es_helper.write_to_es(es,'ping',location,data, data['device_mac'])
    return jsonify({'status':200})
예제 #2
0
파일: app.py 프로젝트: shakthydoss/geopush
def push():
    data = request.json
    data['@timestamp']=getcts()
    print data
    #find city by lan and lon
    location = 'chennai'
    es_helper.write_to_es(es,'data',location,data)
    res = es_helper.search_by_lat_lon(es,data['location']['lat'],data['location']['lon'],"1km")
    return jsonify({'status':'200', 'data':res})