This commit is contained in:
DingZQ
2022-10-15 17:19:54 +08:00
parent edbe03a759
commit 99a2fd4b65

View File

@@ -93,13 +93,13 @@ async def fastapi_get_current_operaiton_id(network: str) -> int:
return get_current_operation(network) return get_current_operation(network)
@app.get("/syncwithserver/") @app.get("/syncwithserver/")
def fastapi_sync_with_server(network: str, operationid: int) -> ChangeSet: async def fastapi_sync_with_server(network: str, operationid: int) -> ChangeSet:
return sync_with_server(network, operationid) return sync_with_server(network, operationid)
@app.post("/batch/") @app.post("/batch/")
def fastapi_execute_batch_commands(network: str, request: Request) -> ChangeSet: async def fastapi_execute_batch_commands(network: str, request: Request) -> ChangeSet:
print(request) print(request)
jsTxt = request.json() jsTxt = await request.json()
print(jsTxt) print(jsTxt)
joOps = json.loads(jsTxt)['operations'] joOps = json.loads(jsTxt)['operations']
cs:ChangeSet = ChangeSet({}) cs:ChangeSet = ChangeSet({})