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 self.apis_wrong
def post(self, users): print(PRINT_API_NAME.format(users)) control_user = CUsers() apis = { "register": "control_user.register()", "login": "******", "update_info": "control_user.update_info()", "update_pwd": "control_user.update_pwd()" } if users in apis: return eval(apis[users]) return self.apis_wrong
def post(self, users): print PRINT_API_IS.format(users) judgeData = JudgeData() #实例化 control_user = CUsers() #实例化 apis = { "register": "control_user.register()", "login": "******" } #判断是否包含该API if judgeData.inData(users, apis): return eval(apis[users]) return apis_wrong
def __init__(self): from control.CUsers import CUsers self.cusers = CUsers()