-
Notifications
You must be signed in to change notification settings - Fork 1
/
end_points.py
executable file
·32 lines (27 loc) · 1.4 KB
/
end_points.py
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 flask_restful import Api
from api.about.about_controller import AboutController
from api.index_controller import IndexController
from api.source.source_controller import SourceController
from api.source.source_item_controller import SourceItemController
from api.source_for_location.source_for_location_controller import SourceForLocationController
from api.sources.cptec.cptec_today_controller import CPTECTodayController
from api.sources.open_weather.open_weather_today_controller import OpenWeatherTodayController
from api.vote.vote_controller import VoteController
class EndPoints:
def __init__(self, app):
self.__api = Api(app)
def add_resources(self):
# TEST
self.__api.add_resource(IndexController, '/')
# GENERAL
self.__api.add_resource(AboutController, '/about')
# SOURCE
self.__api.add_resource(SourceController, '/source')
self.__api.add_resource(SourceItemController, '/source/<source_name>')
self.__api.add_resource(SourceForLocationController, '/source/list-available/<country>')
# VOTES
self.__api.add_resource(VoteController, '/vote_of/<location>/source/<string:source>')
# CPTEC
self.__api.add_resource(CPTECTodayController, '/CPTEC/INPE/today/<region>/<city>')
# OPEN WEATHER
self.__api.add_resource(OpenWeatherTodayController, '/Open Weather/today/<latitude>/<longitude>')