class User(db.Model): __tablename__ = "user" id = db.Column(db.Integer,primary_key=True,autoincrement=True) telephone = db.Column(db.String(11),nullable=False) username = db.Column(db.String(50),nullable=False) password = db.Column(db.String(100),nullable=False) content = db.Column(db.Text,nullable=False)
class WorkResume(Base): __tablename__ = 'resume_work' __table_args__ = ({'comment': '306 工作经历表'}) userId = db.Column('userId', db.BigInteger, comment='关联userId号') company = db.Column(db.String(100), comment='公司名') startTime = db.Column(db.String(50), comment='开始时间') endTime = db.Column(db.String(50), comment='结束时间') experience = db.Column(db.String(500), comment='在职经历')
class Classfiy(db.Model): """文章分类的表""" __tablename__ = 'classfiy' id = db.Column(db.Integer, primary_key=True, autoincrement=True) p_id = db.Column(db.Integer, primary_key=True, server_default='0') list_title = db.Column(db.String(30), nullable=False) key_str = db.Column(db.String(30), nullable=False, unique=True, index=True) height_light = db.Column(db.Integer, server_default='0')
class OtherResume(Base): __tablename__ = 'resume_other' __table_args__ = ({'comment': '306 简历其他项'}) userId = db.Column('userId', db.BigInteger, comment='关联userId号') expectedJobType = db.Column(db.String(50), default='不限', comment='期望工作类型') shortJobTime = db.Column(db.String(50), default='不限', comment='短期工作时间') ableWorkDay = db.Column(db.String(50), default='均可', comment='可上班时间') selfIntroduction = db.Column(db.String(500), comment='自我介绍') isFullTime = db.Column(db.SmallInteger, comment='是否支持全职上班 1-是 0-否')
class Article(Base): """存储文章内容表""" __tablename__ = 'article' id = db.Column(db.Integer, primary_key=True, autoincrement=True) title = db.Column(db.String(30)) subtitle = db.Column(db.String(150)) brief = db.Column(db.String(255)) content = db.Column(db.Text) date = db.Column(db.TIMESTAMP, server_default=db.func.now()) key = db.Column(db.String(30)) volume = db.Column(db.Integer, nullable=False, server_default='0') category_id = db.Column(db.Integer, db.ForeignKey("classfiy.id")) category = db.relationship("Classfiy", backref=db.backref('articles'))
class Job_Signup(Base): __tablename__ = 'job_signup' __table_args__ = ({'comment': '302 提交工作记录表'}) userId = db.Column('userId', db.BigInteger, comment='申请学生的用户id号') stuId = db.Column('stuId', db.BigInteger, comment='申请学生的学生id号') jobId = db.Column('jobId', db.BigInteger, comment='申请工作的id号') message = db.Column(db.String(200), comment='学生给企业的留言') status = db.Column(db.SmallInteger, default=1, comment='状态 1-已报名 2-已录用 3-已到岗 4-已结算')
class Student(Base): __tablename__ = 'student' __table_args__ = ({'comment': '308 学生信息表'}) sname = db.Column(db.String(20), comment='学生的名字') uId = db.Column(db.BigInteger, comment='关联的用户id') age = db.Column(db.Integer, comment='用户的年龄') nativePlace = db.Column(db.String(50), comment='所在城市') place = db.Column(db.String(50), comment='所在地级市') phoneNumber = db.Column(db.String(80), comment='手机号') birthday = db.Column(db.String(50), comment='生日') height = db.Column(db.String(50), comment='身高') eduStatus = db.Column(db.SmallInteger, default=1, comment='教育状态 1-在读 2-已毕业') bestEdu = db.Column(db.String(20), default="本科", comment='最高学历') email = db.Column(db.String(50), comment='邮箱') qqNum = db.Column(db.String(20), comment='QQ') weChat = db.Column(db.String(50), comment='微信号') sex = db.Column(db.SmallInteger, default=1, comment='性别 1-男 2-女')
class Picture(Base): """存储图片""" __tablename__ = 'picture' id = db.Column(db.Integer, primary_key=True, autoincrement=True) big_pic = db.Column(db.String(100)) thumb_pic = db.Column(db.String(100)) def __init__(self, big_pic, thumb_pic): self.big_pic = big_pic self.thumb_pic = thumb_pic def db_add(self, result): try: db.session.add(result) db.session.commit() except Exception as e: db.session.rollback() raise e
class User(Base): __tablename__ = 'user' __table_args__ = ({'comment': '305 用户表'}) loginName = db.Column(db.String(50), nullable=True, unique=True, comment='登录名') _password = db.Column('password', db.String(210), nullable=True, comment='登录密码') type = db.Column(db.SmallInteger, default=3, comment='身份类型 1-系统管理员 2-企业 3-学生') openId = db.Column(db.String(300), unique=True, comment='微信小程序用户唯一标识id') @property def password(self): return self._password # 使用python pdkdf2加盐密码 @password.setter def password(self, raw): self._password = generate_password_hash(raw) # 验证密码 def check_password(self, raw): if not self._password: return False return check_password_hash(self._password, raw) # 登录时的验证操作 @staticmethod def verify(loginName, password): user = User.query.filter_by(loginName=loginName).first_or_404() if not user.check_password(password): raise AuthFailed() # scope = 'AdminScope' if user.auth == 2 else 'UserScope' return {'uid': user.id}
class Company(Base): __tablename__ = 'company' __table_args__ = ({'comment': '307 公司信息表'}) cname = db.Column(db.String(20), comment='公司的名字') uId = db.Column(db.BigInteger, comment='关联的用户id') cplace = db.Column(db.String(50), comment='所在城市') cphone = db.Column(db.String(80), comment='企业电话') cemail = db.Column(db.String(50), comment='企业邮箱') ctype = db.Column(db.String(50), comment='所属行业') cinfo = db.Column(db.String(500), comment='简介') pphone = db.Column(db.String(80), comment='联系人手机号') pname = db.Column(db.String(20), comment='联系人姓名') isVerify = db.Column(db.SmallInteger, default=1, comment='是否通过审核 1-待审核 2-通过 3-未通过')
class EduResume(Base): __tablename__ = 'resume_edu' __table_args__ = ({'comment': '304 教育经历表'}) userId = db.Column('userId', db.BigInteger, comment='关联userId号') school = db.Column(db.String(100), comment='学校') major = db.Column(db.String(50), comment='专业') degree = db.Column(db.String(50), comment='学历') startTime = db.Column(db.String(50), comment='开始时间') endTime = db.Column(db.String(50), comment='结束时间') experience = db.Column(db.String(500), comment='在校经历')
class User(db.Model): """管理员账号表""" __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), nullable=False, unique=True) password = db.Column(db.String(32), nullable=False)
class Job(Base): __tablename__ = 'job' __table_args__ = ({'comment': '300 工作表'}) tittle = db.Column(db.String(50), comment='工作的标题') reward = db.Column(db.String(20), comment='报酬') place = db.Column(db.String(20), comment='地点') settlement = db.Column(db.SmallInteger, nullable=False, default=3, comment='工作结算方式 1-日结 2-周结 3-完工结') isBagEating = db.Column(db.SmallInteger, nullable=False, default=2, comment='是否包吃 1-是 2-否') encase = db.Column(db.SmallInteger, nullable=False, default=2, comment='是否包住 1-是 2-否') isTrafficSubsidy = db.Column(db.SmallInteger, nullable=False, default=2, comment='是否有交通补贴 1-是 2-否') royalty = db.Column(db.SmallInteger, nullable=False, default=2, comment='是否有提成 1-是 2-否') type = db.Column(db.String(20), comment='工作类型') recruitNum = db.Column(db.Integer, default=1, comment='招聘人数') sex = db.Column(db.String(20), comment='性别要求 1-男 2-女 3-男女不限') browseTimes = db.Column(db.Integer, default=100, comment='浏览次数') content = db.Column(db.String(500), comment='工作内容') startTime = db.Column(db.String(80), comment='开始时间') endTime = db.Column(db.String(80), comment='结束时间') detailPlace = db.Column(db.String(20), comment='详细地址') fromCompany = db.Column(db.String(80), comment='发布的企业') withPeople = db.Column(db.String(20), comment='企业联系人') signNum = db.Column(db.Integer, default=0, comment='当前报名人数人数') phone = db.Column(db.String(20), comment='企业联系人电话') email = db.Column(db.String(20), comment='企业联系人邮箱') cId = db.Column(db.BigInteger, comment='企业的id号') status = db.Column(db.SmallInteger, default=1, comment='当前状态 1-待审批 2-进行中 3-已结束') testUnique = db.Column(db.String(20), unique=True, comment='测试是否唯一')
class User(db.Model): id = db.Column(db.Integer,primary_key=True,autoincrement=True) user = db.Column(db.String(30),nullable=False) password = db.Column(db.String(100),nullable=False) email = db.Column(db.String(80))
class Search(Base): __tablename__ = 'search' __table_args__ = ({'comment': '303 热门搜索表'}) message = db.Column(db.String(20), comment='搜索的信息')
class ComSign2(Base2): __tablename__ = 'com_sign2' __tablenum__ = "101" __table_args__ = ({'comment': '309 公司信息提交审核记录表'}) name = db.Column(db.String(80), comment='名字')