def getDepartmentByCity(): result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = ParameterService.getDepartmentByCity() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def updateQuarantinePeriod(): result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = ParameterService.updateQuarantinePeriod() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def getCategories(): result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = CategoryService.getCategories() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def deleteNeighborhood(): result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = NeighborhoodService.deleteNeighborhood() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def deleteDocumentType(): result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = DocumentTypeService.deleteDocumentType() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def updateExamResult(): result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = ExamService.updateExamResult() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def getAllHistory(start, limit): result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = ExamService.getAllHistory(start, limit) if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def authorize(): """ This function authorize a certain user""" result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = UserService.authorize() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def getUnauthorized(start, limit): """ This function obtains all unauthorized users""" result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = UserService.getUnauthorized(start, limit) if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def getUser(): """ This function obtains a user""" result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = UserService.getUser() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def registerAdmin(): """ This function registers a user of type Admin""" result = Response(HTTP_CODE.ERROR, {}).toMap() try: response = UserService.registerAdmin() if response != RESPONSE.EMPTY.copy(): result = Response(HTTP_CODE.SUCESSFUL, response).toMap() except Exception as e: print(e) return result
def home(): return Response(HTTP_CODE.SUCESSFUL, "Hello from Parameter!").toMap()
def home(): return Response(HTTP_CODE.SUCESSFUL, "Hello from Exam!").toMap()
def wrapper(*args, **kargs): if True: result = func(*args, **kargs) else: result = Response(HTTP_CODE.FORBIDDEN, RESPONSE.EMPTY).toMap() return result