-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from RoryConnolly/feat-6-Swagger-Docs-and-Read-Me
Added Swagger Docs, PostMan Collection
- Loading branch information
Showing
9 changed files
with
607 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "e027c553-e7a4-4071-8e83-82579672a2f2", | ||
"name": "DogCollarRequests", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Get a specific CollarData Response by collarId and collarResp", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3000/api/fetch/SpecificCollarRespByID?collarId=abc1&collarResp=1", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"fetch", | ||
"SpecificCollarRespByID" | ||
], | ||
"query": [ | ||
{ | ||
"key": "collarId", | ||
"value": "abc1" | ||
}, | ||
{ | ||
"key": "collarResp", | ||
"value": "1" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Request all CollarData", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3000/api/fetch/all", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"fetch", | ||
"all" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Scan all and filter by Barking Params", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3000/api/fetch/allByBarking?barking=low", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"fetch", | ||
"allByBarking" | ||
], | ||
"query": [ | ||
{ | ||
"key": "barking", | ||
"value": "low" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Scan all and filter by Activity params ", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3000/api/fetch/allByActivity?activity=low", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"fetch", | ||
"allByActivity" | ||
], | ||
"query": [ | ||
{ | ||
"key": "activity", | ||
"value": "low" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Scan all and filter by Location", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3000/api/fetch/allByLocation?location=90210", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"fetch", | ||
"allByLocation" | ||
], | ||
"query": [ | ||
{ | ||
"key": "location", | ||
"value": "90210" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Put collar data into the database", | ||
"request": { | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Content-Type", | ||
"name": "Content-Type", | ||
"value": "application/json", | ||
"type": "text" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n\t\"activity\": \"low\",\n \"location\": \"37901\",\n \"barking\": \"high\",\n \"dogName\": \"Bouncer\",\n \"collarResp\": \"11\",\n \"collarId\": \"abc3\"\n}" | ||
}, | ||
"url": { | ||
"raw": "http://localhost:3000/api/pushCollarData", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"pushCollarData" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Delete Collar data entry from DB by collarID and collarResp", | ||
"request": { | ||
"method": "DELETE", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "http://localhost:3000/api/remove?collarId=abc3&collarResp=11", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"remove" | ||
], | ||
"query": [ | ||
{ | ||
"key": "collarId", | ||
"value": "abc3" | ||
}, | ||
{ | ||
"key": "collarResp", | ||
"value": "11" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Get All results for specific collar", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3000/api/fetch/allByCollarId?collarId=abc2", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3000", | ||
"path": [ | ||
"api", | ||
"fetch", | ||
"allByCollarId" | ||
], | ||
"query": [ | ||
{ | ||
"key": "collarId", | ||
"value": "abc2" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
const mongoose = require('mongoose'); | ||
// TODO add schema validation to the collar response data objects | ||
|
||
const { Schema } = mongoose; | ||
// const mongoose = require('mongoose'); | ||
|
||
const dataModel = new Schema( | ||
{ | ||
collarId: { type: String }, | ||
collarResp: { type: String }, | ||
dogName: { type: String }, | ||
barking: { type: String }, | ||
activity: { type: String }, | ||
location: { type: String }, | ||
} | ||
); | ||
// const { Schema } = mongoose; | ||
|
||
module.exports = mongoose.model('dataPacket', dataModel); | ||
// const dataModel = new Schema( | ||
// { | ||
// collarId: { type: String }, | ||
// collarResp: { type: String }, | ||
// dogName: { type: String }, | ||
// barking: { type: String }, | ||
// activity: { type: String }, | ||
// location: { type: String }, | ||
// } | ||
// ); | ||
|
||
// module.exports = mongoose.model('dataPacket', dataModel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.