File size: 786 Bytes
15adf17
5a97e5d
 
15adf17
5a97e5d
15adf17
 
5a97e5d
15adf17
 
 
 
5a97e5d
15adf17
 
 
5a97e5d
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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