Skip to content

Commit

Permalink
#34: Add resources to api
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Aug 14, 2019
1 parent 7f13768 commit 8fbbaeb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
from src.resources.entities.user_groups_endpoints import *
from src.resources.entities.users_endpoints import *
from src.resources.non_entities.sessions_endpoints import *
from src.resources.table_endpoints.table_endpoints import UsersInvestigations, UsersInvestigationsCount, \
InstrumentsFacilityCycles, InstrumentsFacilityCyclesCount, InstrumentsFacilityCyclesInvestigations, \
InstrumentsFacilityCyclesInvestigationsCount
from src.swagger.swagger_generator import swagger_gen

swagger_gen.write_swagger_spec()
Expand Down Expand Up @@ -200,5 +203,15 @@
api.add_resource(UserGroupsCount, "/usergroups/count")
api.add_resource(UserGroupsFindOne, "/usergroups/findOne")

# Table specific endpoints
api.add_resource(UsersInvestigations, "/users/<string:id>/investigations")
api.add_resource(UsersInvestigationsCount, "/users/<string:id>/investigations/count")
api.add_resource(InstrumentsFacilityCycles, "/instruments/<string:id>/facilityCycles")
api.add_resource(InstrumentsFacilityCyclesCount, "/instruments/<string:id>/facilityCycles/count")
api.add_resource(InstrumentsFacilityCyclesInvestigations,
"/instruments/<string:id>/facilityCycles<string:id>/investigations")
api.add_resource(InstrumentsFacilityCyclesInvestigationsCount,
"/instruments/<string:id>/facilityCycles<string:id>/investigations/count")

if __name__ == "__main__":
app.run(debug=config.is_debug_mode())

0 comments on commit 8fbbaeb

Please sign in to comment.