File size: 853 Bytes
0a7b47e
 
d7df8d0
 
0a7b47e
d7df8d0
0a7b47e
 
d7df8d0
 
0a7b47e
 
d7df8d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a7b47e
d7df8d0
0a7b47e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from fastapi import APIRouter, Body
from fastapi.responses import JSONResponse
from restful.controllers import ForecastingControllers
from restful.schemas import ForecastingServiceSchema

""" API Router """
route = APIRouter()

""" Forecasting Controller """
__CONTROLLER = ForecastingControllers()


""" Algorithms Route """
@route.get(path = '/algorithms')
async def algorithms_route() -> JSONResponse:
    return await __CONTROLLER.algorithms_controller()


""" Currencies Route """
@route.get(path = '/currencies')
async def currencies_route() -> JSONResponse:
    return await __CONTROLLER.currencies_controller()


""" Forecasting Route """
@route.post(path = '/forecasting')
async def forecasting_route(
    payload: ForecastingServiceSchema = Body(...)
) -> JSONResponse:
    return await __CONTROLLER.forecasting_controller(payload = payload)