Add get_tags

This commit is contained in:
DingZQ
2023-04-06 22:16:05 +08:00
parent 02b5ef71f2
commit 9d6b685439

View File

@@ -950,6 +950,10 @@ async def fastapi_get_tag_schema(network: str) -> dict[str, dict[str, Any]]:
async def fastapi_get_tag(network: str, t_type: str, id: str) -> dict[str, Any]:
return get_tag(network, t_type, id)
@app.get('/gettags/')
async def fastapi_get_tags(network: str) -> list[dict[str, Any]]:
return get_tags(network)
# example:
# set_tag(p, ChangeSet({'t_type': TAG_TYPE_NODE, 'id': 'j1', 'tag': 'j1t' }))
# set_tag(p, ChangeSet({'t_type': TAG_TYPE_LINK, 'id': 'p0', 'tag': 'p0t' }))