-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
94 lines (79 loc) · 4.19 KB
/
app.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import os
from flask import Flask
from flask_restful import Api
from flask_jwt_extended import JWTManager
from db import db
import pymysql
from resources.user import Prisoner_Login, Official_Login, Business_Login, Relative_Login, User_Logout
from resources.reports import (
PrisonerReport, GuardReport, WardenReport, PrisonReport, ChoreSheet, ChiefWardenReport, AdminReport,
RelativeSheet, BusinessSheet, VisitSheet, PrisonerPrison, PrisonerBusiness,BusinessRequirement,UpdateRequirement,
GuardWarden, GuardChiefWarden, WardenChiefWarden, ChiefWardenAdmin, BusinessAll
)
from resources.chore import Chore, ChorePrison, ChorePrisoner
from resources.shift import ShiftAssignment, ShiftDeletion
from resources.facility import Facility
from resources.relative import Relative, RelativePrison
from resources.visit import Visit
from resources.business import Business, EmpBidComb, updateBusID
from resources.prison import Prison, Prisons_All
from resources.prisoner import Prisoner, Prisoners, AddPrisonerComponents, GetPrisonerPrison
from resources.crime import Crime, Crime_Records
from resources.official import Official, Wardens, Guards, ChiefWardens, GuardWardenComb, UpdateMgrID
basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
app.secret_key = os.urandom(24)
api = Api(app)
jwt = JWTManager(app)
api.add_resource(Prisoner_Login, '/prisoner_login')
api.add_resource(Official_Login, '/official_login')
api.add_resource(Business_Login, '/business_login')
api.add_resource(Relative_Login, '/relative_login')
api.add_resource(User_Logout, '/logout')
api.add_resource(PrisonerReport, '/prisoner_report/<int:pid>')
api.add_resource(GuardReport, '/guard_report/<int:_id>')
api.add_resource(WardenReport, '/warden_report/<int:_id>')
api.add_resource(PrisonReport, '/prison_report/<int:pno>')
api.add_resource(ChoreSheet, '/chore_sheet/<int:pno>')
api.add_resource(ChiefWardenReport, '/chief_warden_report/<int:_id>')
api.add_resource(AdminReport, '/admin_report/<int:_id>')
api.add_resource(RelativeSheet, '/relative_sheet/<int:rid>')
api.add_resource(BusinessSheet, '/business_sheet/<int:bid>')
api.add_resource(BusinessAll, '/business_registered')
api.add_resource(VisitSheet, '/visit_sheet/<int:prison_no>')
api.add_resource(PrisonerPrison, '/prisoner_prison/<int:prison_no>')
api.add_resource(PrisonerBusiness,'/prisoner_business/<int:bid>')
api.add_resource(GuardWarden, '/guard_warden/<int:empid>')
api.add_resource(GuardChiefWarden, '/guard_chief_warden/<int:pno>')
api.add_resource(WardenChiefWarden, '/warden_chief_warden/<int:empid>')
api.add_resource(ChiefWardenAdmin, '/chief_warden_admin/<int:empid>')
api.add_resource(BusinessRequirement,'/business_requirement/<int:bid>')
api.add_resource(UpdateRequirement, '/update_business_requirement/<int:bid>')
api.add_resource(Chore, '/chore')
api.add_resource(ChorePrison, '/chore_prison/<int:pno>')
api.add_resource(ChorePrisoner, '/chore_prisoner/<int:pno>')
api.add_resource(ShiftAssignment, '/shift/<int:_id>')
api.add_resource(ShiftDeletion, '/shift/<int:_id>/<int:shiftnumber>')
api.add_resource(Facility, '/facility/<int:pno>')
api.add_resource(Relative, '/relative/<int:pid>')
api.add_resource(RelativePrison, '/relative_prison/<int:pno>')
api.add_resource(Visit, '/visit')
api.add_resource(Prison, '/prison/<int:pno>')
api.add_resource(Prisons_All, '/prison/all/<int:_id>')
api.add_resource(Business, '/business/<int:bus_id>')
api.add_resource(EmpBidComb, '/emp_bid_comb/<int:pno>')
api.add_resource(updateBusID, '/update_bus_id')
api.add_resource(GuardWardenComb, '/guard_warden_comb/<int:empid>')
api.add_resource(UpdateMgrID, '/update_mgr_id')
api.add_resource(Prisoner, '/prisoner/<int:pid>')
api.add_resource(Prisoners, '/prisoners/all/<int:_id>')
api.add_resource(AddPrisonerComponents, '/prisoner_form_details/<int:pno>')
api.add_resource(GetPrisonerPrison, '/prisonerprison/<int:_id>')
api.add_resource(Crime, '/crime/<int:cid>')
api.add_resource(Crime_Records, '/crime_records/<int:pid>')
api.add_resource(Official, '/official/<int:empid>')
api.add_resource(Wardens, '/official/wardens/<int:_id>')
api.add_resource(Guards, '/official/guards/<int:_id>')
api.add_resource(ChiefWardens, '/official/chiefwardens/<int:_id>')
if __name__ == '__main__':
app.run(debug=True)