Ejemplo n.º 1
0
 def switch(self):
     if self.data is not None and self.param == "create":
         answer = news_api.news_verification(self.data)
         return answer
     else:
         answer = gs.converter(gs.converter(news_api.get_news_order_by_data()))
         return answer
Ejemplo n.º 2
0
 def switch(self):
     if self.param == "get_top_task" and self.data is not None:
         answer = gs.converter(score.get_top_task(self.data["id_event"]))
         return answer
     else:
         answer = gs.converter(score.get_scoreboard(self.data["id_event"]))
         return answer
Ejemplo n.º 3
0
 def switch(self):
     if self.data is not None and self.param == "create":
         answer = comments_api.comment_verification(self.data)
         return answer
     if self.data is not None and self.param == "get":
         answer = gs.converter(
                     gs.converter(
                         comments_api.get_comments_by_id_news(self.data.get(names.ID_NEWS, None))))
         return answer
Ejemplo n.º 4
0
 def switch(self):
     if self.param == "get_user_name" and self.data is not None:
         self.data["id_user"] = session_verification(self.data["UUID"])
         print(self.data["id_user"])
         answer = gs.converter(
             gs.converter(auth.get_user_name(self.data["id_user"])))
         return answer
     else:
         answer = auth.login_verification(self.data)
         return answer
Ejemplo n.º 5
0
 def switch(self):
     if self.param == "find" and self.data is not None:
         answer = gs.converter(
             show.find_event(self.data[names.NAME],
                             int(self.data[names.PAGE]))[names.DATA][0])
         return answer
     elif self.param == "current" and self.data is not None:
         answer = gs.converter(show.current_event(self.data[names.PAGE]))
         return answer
     elif self.param == "end" and self.data is not None:
         answer = gs.converter(show.end_event(self.data[names.PAGE]))
         return answer
     elif self.param == "registration" and self.data is not None:
         answer = gs.converter(edit.registration_event(self.data))
         return answer
     elif self.param == "update" and self.data is not None:
         answer = gs.converter(edit.update_event(self.data))
         return answer
     elif self.param == "reg_user" and self.data is not None:
         self.data["id_user"] = session_verification(self.data["UUID"])
         answer = gs.converter(reg_user(self.data))
         return answer
     elif self.param == "descr" and self.data is not None:
         answer = gs.converter(show.page_event(self.data))
         return answer
     elif self.param == "info_event" and self.data is not None:
         answer = gs.converter(show.info_event(self.data["id_event"]))
         return answer
     elif self.param is None and self.data[names.PAGE] is not None:
         self.data["id_user"] = session_verification(self.data["UUID"])
         answer = gs.converter(
             show.all_event(self.data[names.ID_USER],
                            self.data[names.PAGE]))
         return answer
Ejemplo n.º 6
0
 def parse_data(self):
     self.data = self.__args.get('data', None)
     self.param = self.__args.get('param', None)
     print("param: ", self.param)
     self.data = gs.converter(self.data)
     print("data: ", self.data)
     return
Ejemplo n.º 7
0
 def parse_data(self):
     self.data = self.__args.get('data', None)
     self.param = self.__args.get('param', None)
     print("param: ", self.param)
     print("data: ", self.data)
     self.data = gs.converter(self.data)
     self.data["id_user"] = session_verification(self.data["UUID"])
Ejemplo n.º 8
0
 def get(self):
     try:
         print("Scoreboard")
         self.parse_data()
         answer = gs.converter(self.switch())
         print("answer: ", answer)
         return answer, 200, {'Access-Control-Allow-Origin': '*'}
     except:
         return "Error", 200, {'Access-Control-Allow-Origin': '*'}