Example #1
0
    def get(category):
        print(PRINT_API_NAME.format(category))

        apis = {
            "get_all_category": "self.control_category.get_all_category()",
            "get_category_by_sid": "self.control_category.get_category_by_sid()",
        }
        return eval(apis[category])
Example #2
0
    def get(locations):
        print(PRINT_API_NAME.format(locations))

        apis = {"get_city_location": "control_location.get_city_location()"}

        if locations in apis:
            return eval(apis[locations])

        return APIS_WRONG
    def get(card):
        print(PRINT_API_NAME.format(card))

        apis = {"get_cardpkg": "control_coupon.get_cart_pkg()"}

        if card in apis:
            return eval(apis[card])

        return APIS_WRONG
Example #4
0
    def post(self, category):
        print(PRINT_API_NAME.format(category))

        apis = {}

        if category in apis:
            return eval(apis[category])

        return
Example #5
0
    def post(votes):
        print(PRINT_API_NAME.format(votes))

        apis = {"make_vote": "self.cvote.make_vote()"}

        if votes in apis:
            return eval(apis[votes])

        return APIS_WRONG
Example #6
0
    def get(self, users):
        print(PRINT_API_NAME.format(users))

        control_user = CUsers()
        apis = {"all_info": "control_user.all_info()"}

        if users in apis:
            return eval(apis[users])

        return APIS_WRONG
    def post(card):
        print(PRINT_API_NAME.format(card))

        apis = {
            "update_coupons": "control_coupon.add_cardpackage()",
        }

        if card in apis:
            return eval(apis[card])

        return APIS_WRONG
Example #8
0
    def get(orders):
        print(PRINT_API_NAME.format(orders))

        apis = {
            "get_order_list": "control_order.get_order_list()",
            "get_order_abo": "control_order.get_order_abo()",
            "get_order_user": "******"
        }

        if orders not in apis:
            return APIS_WRONG

        return eval(apis[orders])
Example #9
0
    def get(votes):
        print(PRINT_API_NAME.format(votes))

        apis = {
            "get_all": "self.cvote.get_all()",
            "get_host": "self.cvote.get_host()",
            "get_vote": "self.cvote.get_vote()",
        }

        if votes in apis:
            return eval(apis[votes])

        return APIS_WRONG
Example #10
0
    def post(cart):
        print()
        print(PRINT_API_NAME.format(cart))

        apis = {
            "delete_product": "self.ccart.del_product()",
            "update": "self.ccart.add_or_update_cart()",
            "get_select_product": "self.ccart.get_carts_by_uid_caid()"
        }

        if cart in apis:
            return eval(apis[cart])

        return APIS_WRONG
Example #11
0
    def post(orders):
        print(PRINT_API_NAME.format(orders))

        apis = {
            "make_main_order": "control_order.make_main_order()",
            "add_order_items": "control_order.add_order_items()",
            "update_order_info": 'control_order.update_order_info()',
            "update_order_status": "control_order.update_order_status()",
            "order_price": "control_order.get_order_price()"
        }

        if orders not in apis:
            return APIS_WRONG

        return eval(apis[orders])
Example #12
0
    def post(users):
        print(PRINT_API_NAME.format(users))

        apis = {
            "register": "control_user.register()",
            "login": "******",
            "update_info": "control_user.update_info()",
            "update_pwd": "control_user.update_pwd()",
            "get_inforcode": "control_user.get_inforcode()",
            "forget_pwd": "control_user.forget_pwd()"
        }

        if users in apis:
            return eval(apis[users])

        return APIS_WRONG