Exemple #1
0
class Electric(db.Model):
    """
    电费表
    """
    id = db.Column(db.Integer, primary_key=True)
    room_id = db.Column(db.Integer, index=True)
    value = db.Column(db.Float)
    date = db.Column(db.Date)
Exemple #2
0
class Dormitory(db.Model):
    """
    宿舍表
    """
    id = db.Column(db.Integer, primary_key=True)
    building = db.Column(db.String)
    floor = db.Column(db.String)
    room = db.Column(db.Integer)
Exemple #3
0
class BusUser(db.Model):
    """
    校巴用户表
    """
    user_id = db.Column(db.Integer, primary_key=True)
    alipay_user_id = db.Column(db.String)
    id_card = db.Column(db.String)
    avatar = db.Column(db.String)
    bus_session = db.Column(db.String)
Exemple #4
0
class TicketOrder(db.Model):
    """
    车票订单
    """
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer)
    bus_ids = db.Column(db.Integer)
    bus_order_id = db.Column(db.Integer, default=None)
    passenger_ids = db.Column(db.String)
    order_id = db.Column(db.String)
    order_type = db.Column(db.Integer)
    order_time = db.Column(db.DateTime)
    order_state = db.Column(db.Integer)
    ticket_date = db.Column(db.DateTime)
Exemple #5
0
class TotalAchievements(db.Model):
    """
    总成绩表
    """
    user_id = db.Column(db.Integer, primary_key=True)
    get_credit = db.Column(db.Integer)
    selected_credit = db.Column(db.Integer)
    average_achievement = db.Column(db.Float)
    average_achievement_point = db.Column(db.Float)

    def get_dict(self):
        return {
            'getCredit': self.get_credit,
            'selectedCredit': self.selected_credit,
            'averageAchievement': self.average_achievement,
            'averageAchievementPoint': self.average_achievement_point
        }
Exemple #6
0
class Profile(db.Model):
    """
    个人档案表
    """
    user_id = db.Column(db.Integer, primary_key=True)
    grade = db.Column(db.Integer)
    college_id = db.Column(db.Integer)
    profession_id = db.Column(db.Integer)
    direction = db.Column(db.String)

    def get_dict(self):
        return {
            'grade': self.grade,
            'college': self.college,
            'profession': self.profession,
            'direction': self.direction
        }
Exemple #7
0
class User(db.Model):
    """
    用户表
    """
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String)
    password = db.Column(db.String)
    room_id = db.Column(db.Integer)
    email = db.Column(db.String)
    open_id = db.Column(db.String)
    jw_pwd = db.Column(db.String)

    def validate_password(self, password):
        return check_password_hash(self.password, password)
Exemple #8
0
class Achievement(db.Model):
    """
    成绩表
    """
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer)
    school_year = db.Column(db.Integer)
    semester = db.Column(db.Integer)
    course_type = db.Column(db.String)
    subdivision_type = db.Column(db.String)
    course_name = db.Column(db.String)
    course_id = db.Column(db.String)
    credit = db.Column(db.Float)
    achievement_point = db.Column(db.Float)
    final_achievements = db.Column(db.Float)
    total_achievements = db.Column(db.Float)
    midterm_achievements = db.Column(db.Float)
    practice_achievements = db.Column(db.Float)
    peacetime_achievements = db.Column(db.Float)
    resit_exam_achievement_point = db.Column(db.Float)

    def get_dict(self):
        return {
            'schoolYear': self.school_year,
            'semester': self.semester,
            'courseType': self.course_type,
            'subdivisionType': self.subdivision_type,
            'courseName': self.course_name,
            'courseId': self.course_id,
            'credit': self.credit,
            'achievementPoint': self.achievement_point,
            'finalAchievements': self.final_achievements,
            'totalAchievements': self.total_achievements,
            'midtermAchievements': self.midterm_achievements,
            'practiceAchievements': self.practice_achievements,
            'peacetimeAchievements': self.peacetime_achievements,
            'resitExamAchievementPoint': self.resit_exam_achievement_point
        }
Exemple #9
0
class ClassSchedule(db.Model):
    """
    课程表
    """
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer)
    school_year = db.Column(db.Integer)
    semester = db.Column(db.Integer)
    subdivision_type = db.Column(db.String)
    course_name = db.Column(db.String)
    course_id = db.Column(db.String)
    credit = db.Column(db.Float)
    teacher = db.Column(db.String)
    classroom = db.Column(db.String)
    weekday = db.Column(db.Integer)
    start_node = db.Column(db.Integer)
    end_node = db.Column(db.Integer)
    start_week = db.Column(db.Integer)
    end_week = db.Column(db.Integer)

    def get_dict(self):
        return {
            'courseId': self.course_id,
            'courseType': self.subdivision_type,
            'courseName': self.course_name,
            'credit': self.credit,
            'teacher': loads(self.teacher),
            'classroom': self.classroom,
            'weekday': self.weekday,
            'startNode': self.start_node,
            'endNode': self.end_node,
            'startWeek': self.start_week,
            'endWeek': self.end_week
        }
Exemple #10
0
class College(db.Model):
    """
    学院表
    """
    id = db.Column(db.Integer, primary_key=True)
    college = db.Column(db.String)
Exemple #11
0
class Profession(db.Model):
    """
    专业表
    """
    id = db.Column(db.Integer, primary_key=True)
    profession = db.Column(db.String)