Add pipe
This commit is contained in:
8
main.py
8
main.py
@@ -2,6 +2,7 @@ import os
|
||||
import io
|
||||
from typing import *
|
||||
from fastapi import FastAPI, File, UploadFile
|
||||
import pip
|
||||
from pydantic import BaseModel
|
||||
from starlette.responses import FileResponse, JSONResponse
|
||||
from fastapi import FastAPI, Response, status
|
||||
@@ -491,7 +492,12 @@ async def fast_get_pipe_schema(network: str) -> dict[str, dict[str, Any]]:
|
||||
|
||||
@app.post("/addpipe/")
|
||||
async def fastapi_add_pipe(network: str, pipe: str, node1: str, node2: str, length: float = 0, diameter: float = 0, roughness: float = 0, minorloss: float = 0, status: str = PIPE_STATUS_OPEN) -> ChangeSet:
|
||||
return add_pipe(network, pipe, node1, node2, length, diameter, roughness, minorloss, status)
|
||||
|
||||
props : dict[str, any] = {}
|
||||
props['id'] = pip
|
||||
props['node1'] = node1
|
||||
props['node2'] = node2
|
||||
return add_pipe(network, ChangeSet(props))
|
||||
|
||||
@app.post("/deletepipe/")
|
||||
async def fastapi_delete_pipe(network: str, pipe: str) -> ChangeSet:
|
||||
|
||||
Reference in New Issue
Block a user