style: 使用ruff格式化角色管理模块,优化导入

This commit is contained in:
insistence
2024-07-12 09:35:55 +08:00
parent bd242c95f7
commit 4a7c9367d4
5 changed files with 374 additions and 190 deletions

View File

@@ -1,19 +1,24 @@
from sqlalchemy import Column, Integer, String, DateTime
from config.database import Base
from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, String
from config.database import Base
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本部门及以下数据权限')
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停用')
@@ -29,6 +34,7 @@ class SysRoleDept(Base):
"""
角色和部门关联表
"""
__tablename__ = 'sys_role_dept'
role_id = Column(Integer, primary_key=True, nullable=False, comment='角色ID')
@@ -39,6 +45,7 @@ class SysRoleMenu(Base):
"""
角色和菜单关联表
"""
__tablename__ = 'sys_role_menu'
role_id = Column(Integer, primary_key=True, nullable=False, comment='角色ID')