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