Shortest path algorithm, tests and Postman
- Added algorithm and endpoint to find the shortest path between two topics; - Added respective test; - Added a JSON collection with API calls that can be imported into Postman for the convenience of the user.
This commit is contained in:
parent
f1170341fb
commit
d7748229ef
9 changed files with 419 additions and 118 deletions
224
ProjectMark.postman_collection.json
Normal file
224
ProjectMark.postman_collection.json
Normal file
|
@ -0,0 +1,224 @@
|
|||
{
|
||||
"info": {
|
||||
"_postman_id": "5a75a442-f614-4bf5-88e5-5c340f1e357c",
|
||||
"name": "ProjectMark",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
||||
"_exporter_id": "349764"
|
||||
},
|
||||
"item": [
|
||||
{
|
||||
"name": "Post topic",
|
||||
"protocolProfileBehavior": {
|
||||
"disabledSystemHeaders": {
|
||||
"content-type": true
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"name\": \"Sample topic\",\n \"content\": \"Topic content\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Load topics",
|
||||
"protocolProfileBehavior": {
|
||||
"disabledSystemHeaders": {
|
||||
"content-type": true
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"name\": \"Sample topic\",\n \"content\": \"Topic content\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Update topic",
|
||||
"request": {
|
||||
"method": "PUT",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"name\": \"Updated name\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics/1743621367593",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics",
|
||||
"1743621367593"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get topics",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get topic",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Delete topic",
|
||||
"request": {
|
||||
"method": "DELETE",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics/1743714583807",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics",
|
||||
"1743714583807"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get topic recursively",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get shortest path",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "localhost:3000/api/topics/shortest?idA=1743738900800&idB=1743739100103",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "3000",
|
||||
"path": [
|
||||
"api",
|
||||
"topics",
|
||||
"shortest"
|
||||
],
|
||||
"query": [
|
||||
{
|
||||
"key": "idA",
|
||||
"value": "1743738900800"
|
||||
},
|
||||
{
|
||||
"key": "idB",
|
||||
"value": "1743739100103"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue