Refine Json for getLinks

This commit is contained in:
DingZQ
2022-09-03 16:34:21 +08:00
parent be39975756
commit c70d798ee0

View File

@@ -145,7 +145,12 @@ async def fastapi_get_links(network: str):
async def fastapi_get_link_nodes(network: str, link: str):
result = get_link_nodes(network, link)
return [result.value.from_node, result.value.to_node]
return JSONResponse(
status_code = status.HTTP_200_OK,
content={
'start': result.value.from_node,
'end': result.value.to_node
})
@app.post("/addlink/")
async def fastapi_add_link(network: str, link: str, fromNode: str, toNode: str):