File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 11"""app.data"""
2+ import enum
3+
24from ..services .location .csbs import CSBSLocationService
35from ..services .location .jhu import JhuLocationService
46from ..services .location .nyt import NYTLocationService
57
8+
9+ class Sources (str , enum .Enum ):
10+ """
11+ A source available for retrieving data.
12+ """
13+
14+ jhu = "jhu"
15+ csbs = "csbs"
16+ nyt = "nyt"
17+
18+
619# Mapping of services to data-sources.
720DATA_SOURCES = {
821 "jhu" : JhuLocationService (),
Original file line number Diff line number Diff line change 33
44from fastapi import APIRouter , HTTPException , Request
55
6- from ..data import DATA_SOURCES
6+ from ..data import DATA_SOURCES , Sources
77from ..models import LatestResponse , LocationResponse , LocationsResponse
88
99V2 = APIRouter ()
1010
1111
12- class Sources (str , enum .Enum ):
13- """
14- A source available for retrieving data.
15- """
16-
17- jhu = "jhu"
18- csbs = "csbs"
19- nyt = "nyt"
20-
21-
2212@V2 .get ("/latest" , response_model = LatestResponse )
2313async def get_latest (request : Request , source : Sources = "jhu" ): # pylint: disable=unused-argument
2414 """
You can’t perform that action at this time.
0 commit comments