diff --git a/bootstrap.py b/bootstrap.py index 79f2d92..1f72e34 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -29,6 +29,7 @@ from hub_api.session import SessionStart, SessionEnd, KeepSessionAlive from hub_api.uptime import Uptime from hub_api.greenery import Greenery from hub_api.user import User, UserLogin +from hub_api.city_commands import SaveCity, UpdateCity, DeleteCity, ListCities, SearchCity from flasgger import LazyJSONEncoder, LazyString, Swagger app = flask.Flask('gamification') @@ -81,4 +82,10 @@ api.add_resource(SessionEnd, '/v1.4/session/end') api.add_resource(KeepSessionAlive, '/v1.4/session/keep_alive') api.add_resource(CityInfo, '/v1.4/city_info') api.add_resource(City, '/v1.4/city') +api.add_resource(SaveCity, '/v1.4/city/save_city') +api.add_resource(UpdateCity, '/v1.4/city/update_city') +api.add_resource(DeleteCity, '/v1.4/city/delete_city') +api.add_resource(ListCities, '/v1.4/city/list_cities') +api.add_resource(SearchCity, '/v1.4/city/search_city') api.add_resource(Greenery, '/v1.4/greenery') + diff --git a/hub_api/city_commands.py b/hub_api/city_commands.py new file mode 100644 index 0000000..dbf3522 --- /dev/null +++ b/hub_api/city_commands.py @@ -0,0 +1,62 @@ +""" +HeatPump Service +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2023 Project Author Koa Wells kekoa.wells@concordia.ca +""" + +import json +from flask import Response, request +from flask_restful import Resource +from imports.user_factory import UserFactory +from exports.user_factory import UserFactory as ExUserFactory +import os +from hub_logger import logger +from hub_api.helpers.auth import generate_auth_token, role_required +from persistence.models import UserRoles + +#Admin commands + +class SaveCity(Resource): + def __init__(self): + print() + + @role_required([UserRoles.Admin.value]) + def put(self): + + +class UpdateCity(Resource): + def __init__(self): + print() + + @role_required([UserRoles.Admin.value]) + def put(self): + + class UpdateCity(Resource): + +class DeleteCity(Resource): + def __init__(self): + print() + + @role_required([UserRoles.Admin.value]) + def delete(self): + +#Standard user commands + +class ListCities(Resource): + def __init__(self): + print() + + @role_required([UserRoles.Admin.value]) + def put(self): + +class SearchCity(Resource): + def __init__(self): + print() + + def get(self): + + class UpdateCity(Resource): + def __init__(self): + print() + + def get(self): \ No newline at end of file