abhisheky127's picture
initial commit again
5a97e5d
raw
history blame
786 Bytes
from fastapi import Depends, HTTPException, status
from fastapi import APIRouter, Query
from typing import Optional
from authentication import get_current_user
from apps.demand_assessment.DemandAssessment import DemandAssessment
router = APIRouter()
da = DemandAssessment()
@router.get("/")
def read_demand_assessment(current_user: str = Depends(get_current_user)):
print(da.print_data())
return {"Status": "Alive!!! Hello from Demand Assessment"}
@router.get("/get_demand_score")
async def get_demand_score(
Region: Optional[str] = None,
City: str = Query(..., min_length=1),
District: str = Query(..., min_length=1),
current_user: str = Depends(get_current_user)):
result = da.get_demand_score(Region, City, District)
return result