def save_message(): try: svc = Service() svc_response = svc.save_message(request.data) return SvcUtils.handle_response(svc_response, status.HTTP_201_CREATED) except Exception as ex: return SvcError.handle_error(ex)
def get_message_by_username(username): try: svc = Service() svc_response = svc.get_message_by_username(username) return SvcUtils.handle_response(svc_response, status.HTTP_200_OK) except Exception as ex: return SvcError.handle_error(ex)
def ping(): try: svc = Service() svc_response = svc.ping() return SvcUtils.handle_response(svc_response, status.HTTP_200_OK) except Exception as ex: return SvcError.handle_error(ex)
def process_event(): try: svc = Service() svc.process_event(request.data) return SvcUtils.handle_response(status.HTTP_200_OK) except Exception as ex: return SvcError.handle_error(ex)