增加项目的各个功能

This commit is contained in:
qiaoxinjiu
2026-05-07 19:21:19 +08:00
parent aba1618f89
commit ee6cd4ae66
121 changed files with 9346 additions and 43 deletions

View File

@@ -0,0 +1,33 @@
from sqlalchemy import BigInteger, Column, Integer, SmallInteger, String, TIMESTAMP, text
from sqlalchemy.ext.declarative import declarative_base
from common.sqlSession import to_dict
Base = declarative_base()
Base.to_dict = to_dict
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True, comment='id')
username = Column(String(64), unique=True, nullable=False, comment='登录用户名')
real_name = Column(String(64), comment='真实姓名')
password_hash = Column(String(255), nullable=False, comment='密码哈希')
mobile = Column(String(32), comment='手机号')
email = Column(String(128), comment='邮箱')
avatar = Column(String(255), comment='头像地址')
status = Column(SmallInteger, default=1, comment='1:启用 0:禁用')
last_login_time = Column(TIMESTAMP, nullable=True, comment='最后登录时间')
created_by = Column(BigInteger, comment='创建人')
is_delete = Column(Integer, default=0, comment='0未删除1已删除')
created_time = Column(TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'), nullable=True, comment='创建时间')
updated_time = Column(TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'), server_onupdate=text('CURRENT_TIMESTAMP'), nullable=True, comment='修改时间')
class UserRole(Base):
__tablename__ = 'user_role'
id = Column(BigInteger, primary_key=True, autoincrement=True, comment='id')
user_id = Column(BigInteger, nullable=False, comment='用户id')
role_id = Column(BigInteger, nullable=False, comment='角色id')
is_delete = Column(Integer, default=0, comment='0未删除1已删除')
created_time = Column(TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'), nullable=True, comment='创建时间')