예제 #1
0
    def get(self, info):
        print PRINT_API_IS.format(info)

        apis = {"allinfo": "self.cinfo.get_info()"}

        if self.judgeData.inData(info, apis):
            return eval(apis[info])

        return apis_wrong
예제 #2
0
    def get(self, personal):
        print PRINT_API_IS.format(personal)

        judgeData = JudgeData()  # 实例化
        cpersonal = CPersonal()  # 实例化

        apis = {"findall": "cpersonal.myinfor()"}
        # 判断是否包含该API
        if judgeData.inData(personal, apis):
            return eval(apis[personal])

        return apis_wrong
예제 #3
0
파일: ATeachers.py 프로젝트: jzgmzb/MyTeam
    def get(self, teachers):
        print PRINT_API_IS.format(teachers)

        judgeData = JudgeData()  # 实例化
        cteachers = CTeachers()  # 实例化

        apis = {
            "list": "cteachers.teachers_list()",
            "abo": "cteachers.teachers_abo()"
        }
        # 判断是否包含该API
        if judgeData.inData(teachers, apis):
            return eval(apis[teachers])

        return apis_wrong
예제 #4
0
    def get(competitions):
        print PRINT_API_IS.format(competitions)

        judgeData = JudgeData()  # 实例化
        ccompetitions = CCompetitions()  # 实例化
        apis = {
            "list": "ccompetitions.competitions_list()",  # 获取所有竞赛的简略信息
            "abo": "ccompetitions.competitions_abo()"  # 详细信息
        }

        # 判断是否存在该API
        if judgeData.inData(competitions, apis):
            return eval(apis[competitions])

        return apis_wrong
예제 #5
0
    def get(self, team):
        print PRINT_API_IS.format(team)

        judgeData = JudgeData()  #实例化
        cteams = CTeams()  #实例化

        apis = {
            "allteam": "cteams.teams_list()",
            "teamabo": "cteams.team_abo()",
            "myteam": "cteams.myteams()"
        }
        #判断是否存在该API
        if judgeData.inData(team, apis):
            return eval(apis[team])

        return apis_wrong
예제 #6
0
파일: AUsers.py 프로젝트: jzgmzb/MyTeam
    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
예제 #7
0
파일: AStudents.py 프로젝트: jzgmzb/MyTeam
    def get(self, students):
        print PRINT_API_IS.format(students)

        judgeData = JudgeData()  # 实例化
        cstudents = CStudents()  # 实例化

        apis = {
            "list": "cstudents.students_list()",
            "abo": "cstudents.students_abo()"
        }

        # 判断是否包含该API
        if judgeData.inData(students, apis):
            return eval(apis[students])

        return apis_wrong
예제 #8
0
    def delete(self, team):
        print PRINT_API_IS.format(team)

        judgeData = JudgeData()  # 实例化
        cteams = CTeams()  # 实例化

        apis = {
            "deleteteam": "cteams.delete_team()",
            "deletestudent": "cteams.delete_student()",
            "deletetask": "cteams.delete_task()",
            "deleteteacher": "cteams.delete_teacher()"
        }
        # 判断是否存在该API
        if judgeData.inData(team, apis):
            return eval(apis[team])

        return apis_wrong
예제 #9
0
    def post(self, team):
        print PRINT_API_IS.format(team)

        judgeData = JudgeData()  # 实例化
        cteams = CTeams()

        apis = {
            "newteam": "cteams.new_team()",
            "updateteam": "cteams.update_team()",
            "addstudent": "cteams.add_student()",
            "addteacher": "cteams.add_teacher()",
            "invatestudent": "cteams.invate_add_team()",
            "substudent": "cteams.sub_student()",
            "subteacher": "cteams.sub_teacher()",
            "addtask": "cteams.add_task()",
            "subtask": "cteams.sub_task()",
            "updatetask": "cteams.update_task()"
        }
        # 判断是否存在该API
        if judgeData.inData(team, apis):
            return eval(apis[team])

        return apis_wrong
예제 #10
0
    def delete(self, personal):
        print(PRINT_API_IS.format(personal))

        judgeData = JudgeData()  # 实例化
        cpersonal = CPersonal()  # 实例化

        apis = {
            "stech_delete": "cpersonal.delete_mytech()",
            "scuse_delete": "cpersonal.delete_myuse()"
        }
        # 判断是否包含该API
        if judgeData.inData(personal, apis):
            return eval(apis[personal])

        return apis_wrong