Add method of backdrop

This commit is contained in:
DingZQ
2022-11-07 22:11:21 +08:00
parent 3a9b0d2dbc
commit a4b4634bed

17
main.py
View File

@@ -1133,15 +1133,18 @@ async def fastapi_delete_label(network: str, req: Request) -> ChangeSet:
############################################################
# backdrop 27.[BACKDROP]
############################################################
@app.get('/getbackdropschema/')
async def fastapi_get_backdrop_schema(network: str) -> dict[str, dict[str, Any]]:
return get_backdrop_schema(network)
def get_backdrop_schema(name: str) -> dict[str, dict[str, Any]]:
return api.get_backdrop_schema(name)
@app.get('/getbackdropproperties/')
async def fastapi_get_backdrop(network: str) -> dict[str, Any]:
return get_backdrop(network)
def get_backdrop(name: str) -> dict[str, Any]:
return api.get_backdrop(name)
def set_backdrop(name: str, cs: ChangeSet) -> ChangeSet:
return api.set_backdrop(name, cs)
@app.post('/setbackdropproperties/')
async def fastapi_set_backdrop(network: str, req: Request) -> ChangeSet:
props = await req.json()
return set_backdrop(network, ChangeSet(props))
# inp file