feat: 初始化项目架构

This commit is contained in:
insistence
2024-01-22 23:46:27 +08:00
parent 10b686ff0f
commit f0c38a87dc
347 changed files with 30398 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
from sqlalchemy import Column, Integer, String, DateTime
from config.database import Base
from datetime import datetime
class SysRole(Base):
"""
角色信息表
"""
__tablename__ = 'sys_role'
role_id = Column(Integer, primary_key=True, autoincrement=True, comment='角色ID')
role_name = Column(String(30, collation='utf8_general_ci'), nullable=False, comment='角色名称')
role_key = Column(String(100, collation='utf8_general_ci'), nullable=False, comment='角色权限字符串')
role_sort = Column(Integer, nullable=False, comment='显示顺序')
data_scope = Column(String(1, collation='utf8_general_ci'), default='1', comment='数据范围1全部数据权限 2自定数据权限 3本部门数据权限 4本部门及以下数据权限')
menu_check_strictly = Column(Integer, default=1, comment='菜单树选择项是否关联显示')
dept_check_strictly = Column(Integer, default=1, comment='部门树选择项是否关联显示')
status = Column(String(1, collation='utf8_general_ci'), nullable=False, comment='角色状态0正常 1停用')
del_flag = Column(String(1, collation='utf8_general_ci'), default='0', comment='删除标志0代表存在 2代表删除')
create_by = Column(String(64, collation='utf8_general_ci'), default='', comment='创建者')
create_time = Column(DateTime, default=datetime.now(), comment='创建时间')
update_by = Column(String(64, collation='utf8_general_ci'), default='', comment='更新者')
update_time = Column(DateTime, default=datetime.now(), comment='更新时间')
remark = Column(String(500, collation='utf8_general_ci'), comment='备注')
class SysRoleDept(Base):
"""
角色和部门关联表
"""
__tablename__ = 'sys_role_dept'
role_id = Column(Integer, primary_key=True, nullable=False, comment='角色ID')
dept_id = Column(Integer, primary_key=True, nullable=False, comment='部门ID')
class SysRoleMenu(Base):
"""
角色和菜单关联表
"""
__tablename__ = 'sys_role_menu'
role_id = Column(Integer, primary_key=True, nullable=False, comment='角色ID')
menu_id = Column(Integer, primary_key=True, nullable=False, comment='菜单ID')