Refine code

This commit is contained in:
DingZQ
2022-10-15 18:05:18 +08:00
parent 56d5e7f6a1
commit a5badd1d32

12
main.py
View File

@@ -99,18 +99,8 @@ async def fastapi_sync_with_server(network: str, operationid: int) -> ChangeSet:
@app.post("/batch/")
async def fastapi_execute_batch_commands(network: str, req: Request)-> ChangeSet:
jo_root = await req.json()
print(jo_root)
jo_operations = jo_root['operations']
print(jo_operations)
print(type(jo_operations))
cs: ChangeSet = ChangeSet()
cs.operations = jo_operations
print(cs)
print(type(cs))
ops = cs.operations
print(ops)
print(type(ops))
cs.operations = jo_root['operations']
return execute_batch_commands(network, cs)
# node