You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					54 lines
				
				2.2 KiB
			
		
		
			
		
	
	
					54 lines
				
				2.2 KiB
			| 
								 
											2 years ago
										 
									 | 
							
								from datetime import datetime
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								from sqlalchemy import Column, DateTime, Integer, String
							 | 
						||
| 
								 | 
							
								from config.database import Base
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class SysUser(Base):
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 | 
							
								    用户信息表
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    __tablename__ = 'sys_user'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    user_id = Column(Integer, primary_key=True, autoincrement=True, comment='用户ID')
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								    dept_id = Column(Integer, default=None, comment='部门ID')
							 | 
						||
| 
								 | 
							
								    user_name = Column(String(30), nullable=False, comment='用户账号')
							 | 
						||
| 
								 | 
							
								    nick_name = Column(String(30), nullable=False, comment='用户昵称')
							 | 
						||
| 
								 | 
							
								    user_type = Column(String(2), default='00', comment='用户类型(00系统用户)')
							 | 
						||
| 
								 | 
							
								    email = Column(String(50), default='', comment='用户邮箱')
							 | 
						||
| 
								 | 
							
								    phonenumber = Column(String(11), default='', comment='手机号码')
							 | 
						||
| 
								 | 
							
								    sex = Column(String(1), default='0', comment='用户性别(0男 1女 2未知)')
							 | 
						||
| 
								 | 
							
								    avatar = Column(String(100), default='', comment='头像地址')
							 | 
						||
| 
								 | 
							
								    password = Column(String(100), default='', comment='密码')
							 | 
						||
| 
								 | 
							
								    status = Column(String(1), default='0', comment='帐号状态(0正常 1停用)')
							 | 
						||
| 
								 | 
							
								    del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
							 | 
						||
| 
								 | 
							
								    login_ip = Column(String(128), default='', comment='最后登录IP')
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    login_date = Column(DateTime, comment='最后登录时间')
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								    create_by = Column(String(64), default='', comment='创建者')
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    create_time = Column(DateTime, comment='创建时间', default=datetime.now())
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								    update_by = Column(String(64), default='', comment='更新者')
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    update_time = Column(DateTime, comment='更新时间', default=datetime.now())
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								    remark = Column(String(500), default=None, comment='备注')
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class SysUserRole(Base):
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 | 
							
								    用户和角色关联表
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    __tablename__ = 'sys_user_role'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    user_id = Column(Integer, primary_key=True, nullable=False, comment='用户ID')
							 | 
						||
| 
								 | 
							
								    role_id = Column(Integer, primary_key=True, nullable=False, comment='角色ID')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class SysUserPost(Base):
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 | 
							
								    用户与岗位关联表
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 
											1 year ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    __tablename__ = 'sys_user_post'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    user_id = Column(Integer, primary_key=True, nullable=False, comment='用户ID')
							 | 
						||
| 
								 | 
							
								    post_id = Column(Integer, primary_key=True, nullable=False, comment='岗位ID')
							 |