Skip to content

Tongji-project/API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Location Store Api

use nodejs and mongodb to handle frenquent request of inserting data

api

fetch all the devices

URL

IP:host/devices

Method

GET

description

fetch all the devices from remote database

response

//failed
	{"result": "failed"}
//success
	{"result": "success"}

fetch all the records

URL

IP:host/records

Method

GET

description

fetch all the records from remote database

response

//failed
	{"result": "failed"}
//success
	{"result": "success"}

add a new device

URL

IP:host/device

Method

POST

description

insert a new device

Data Params

{
   "device_id": int,
   "mcc": int,
   "mnc": int,
   "info": String
}

response

//failed
	{"result": "failed"}
//success
	{"result": "success"}

add a new record

URL

IP:host/record

Method

POST

description

insert a new device

Data Params

{
   "created_time": timeStamp,
   "device_id": int,
   "signal": [
   		{
   			"lac": int,
   			"bass": int
   		},
   		{
   			"lac": int,
   			"bass": int
   		},
   		...
   ],
	"gps": {
		"latitude": double,
		"longitude": double
	},
	"state":{
		"battery_usage": double
	}
}

response

//failed
	{"result": "failed"}
//success
	{"result": "success"}

add new records

URL

IP:host/records

Method

POST

description

insert new devices

Data Params

[{
   "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
	}
}
]

response

//failed
	{"result": "failed"}
//success
	{"result": "success"}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published