use nodejs and mongodb to handle frenquent request of inserting data
IP:host/devices
GET
fetch all the devices from remote database
//failed
{"result": "failed"}
//success
{"result": "success"}
IP:host/records
GET
fetch all the records from remote database
//failed
{"result": "failed"}
//success
{"result": "success"}
IP:host/device
POST
insert a new device
{
"device_id": int,
"mcc": int,
"mnc": int,
"info": String
}
//failed
{"result": "failed"}
//success
{"result": "success"}
IP:host/record
POST
insert a new device
{
"created_time": timeStamp,
"device_id": int,
"signal": [
{
"lac": int,
"bass": int
},
{
"lac": int,
"bass": int
},
...
],
"gps": {
"latitude": double,
"longitude": double
},
"state":{
"battery_usage": double
}
}
//failed
{"result": "failed"}
//success
{"result": "success"}
IP:host/records
POST
insert new devices
[{
"created_time": timeStamp,
"device_id": int,
"signal": [
{
"lac": int,
"bass": int
},
{
"lac": int,
"bass": int
},
...
],
"gps": {
"latitude": double,
"longitude": double
},
"state":{
"battery_usage": double
}
},
{
"created_time": timeStamp,
"device_id": int,
"signal": [
{
"lac": int,
"bass": int
},
{
"lac": int,
"bass": int
},
...
],
"gps": {
"latitude": double,
"longitude": double
},
"state":{
"battery_usage": double
}
}
]
//failed
{"result": "failed"}
//success
{"result": "success"}