From a4b4634bed5f37fff5a12c710c99017413f5bfe4 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Mon, 7 Nov 2022 22:11:21 +0800 Subject: [PATCH] Add method of backdrop --- main.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 218437b..e0977d7 100644 --- a/main.py +++ b/main.py @@ -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