seedroute and vlidate

This commit is contained in:
newtbot
2024-01-03 03:51:15 +08:00
parent 088302fa5b
commit 90754c1792
10 changed files with 113 additions and 70 deletions

13
api.MD
View File

@ -8,12 +8,22 @@ curl http://localhost/api/v0/location/3
//post
curl localhost/api/v0/location/new -H "Content-Type: application/json" -X POST -d '{"name": "test", "added_by": "noot" , "description": "test"}'
status: 200
//put
curl localhost/api/v0/location/update -X PUT -H "Content-Type: application/json" -d '{"id": "2" , "name": "test", "added_by": "noot", "description": "test12344444444"}'
status: 200
"message": "Location 13 updated"
//delete
curl localhost/api/v0/location/delete -X DELETE -H "Content-Type: application/json" -d '{"id": "6" }'
status: 200
{
"message": "Location 13 deleted"
}
//sensor
//GET all
curl localhost/api/v0/sensor
@ -68,3 +78,6 @@ curl localhost/api/v0/sensor-data/update -H "Content-Type: application/json" -X
//delete
curl localhost/api/v0/sensor-data/delete -X DELETE -H "Content-Type: application/json" -d '{"id": "3" }'
//seed
curl localhost/api/seed/v0/seed/new -H "Content-Type: application/json" -X POST -d '{"mockLocation": ["test", "test123"]}'