feat: 初始化项目架构
This commit is contained in:
21
ruoyi-fastapi-backend/module_admin/entity/do/config_do.py
Normal file
21
ruoyi-fastapi-backend/module_admin/entity/do/config_do.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysConfig(Base):
|
||||
"""
|
||||
参数配置表
|
||||
"""
|
||||
__tablename__ = 'sys_config'
|
||||
|
||||
config_id = Column(Integer, primary_key=True, autoincrement=True, comment='参数主键')
|
||||
config_name = Column(String(100), nullable=True, default='', comment='参数名称')
|
||||
config_key = Column(String(100), nullable=True, default='', comment='参数键名')
|
||||
config_value = Column(String(500), nullable=True, default='', comment='参数键值')
|
||||
config_type = Column(String(1), nullable=True, default='N', comment='系统内置(Y是 N否)')
|
||||
create_by = Column(String(64), nullable=True, default='', comment='创建者')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
||||
update_by = Column(String(64), nullable=True, default='', comment='更新者')
|
||||
update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
|
||||
remark = Column(String(500), nullable=True, default='', comment='备注')
|
25
ruoyi-fastapi-backend/module_admin/entity/do/dept_do.py
Normal file
25
ruoyi-fastapi-backend/module_admin/entity/do/dept_do.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysDept(Base):
|
||||
"""
|
||||
部门表
|
||||
"""
|
||||
__tablename__ = 'sys_dept'
|
||||
|
||||
dept_id = Column(Integer, primary_key=True, autoincrement=True, comment='部门id')
|
||||
parent_id = Column(Integer, default=0, comment='父部门id')
|
||||
ancestors = Column(String(50), nullable=True, default='', comment='祖级列表')
|
||||
dept_name = Column(String(30), nullable=True, default='', comment='部门名称')
|
||||
order_num = Column(Integer, default=0, comment='显示顺序')
|
||||
leader = Column(String(20), nullable=True, default=None, comment='负责人')
|
||||
phone = Column(String(11), nullable=True, default=None, comment='联系电话')
|
||||
email = Column(String(50), nullable=True, default=None, comment='邮箱')
|
||||
status = Column(String(1), nullable=True, default=0, comment='部门状态(0正常 1停用)')
|
||||
del_flag = Column(String(1), nullable=True, default=0, comment='删除标志(0代表存在 2代表删除)')
|
||||
create_by = Column(String(64), nullable=True, default='', comment='创建者')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
||||
update_by = Column(String(64), nullable=True, default='', comment='更新者')
|
||||
update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
|
46
ruoyi-fastapi-backend/module_admin/entity/do/dict_do.py
Normal file
46
ruoyi-fastapi-backend/module_admin/entity/do/dict_do.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, UniqueConstraint
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysDictType(Base):
|
||||
"""
|
||||
字典类型表
|
||||
"""
|
||||
__tablename__ = 'sys_dict_type'
|
||||
|
||||
dict_id = Column(Integer, primary_key=True, autoincrement=True, comment='字典主键')
|
||||
dict_name = Column(String(100), nullable=True, default='', comment='字典名称')
|
||||
dict_type = Column(String(100), nullable=True, default='', comment='字典类型')
|
||||
status = Column(String(1), nullable=True, default='0', comment='状态(0正常 1停用)')
|
||||
create_by = Column(String(64), nullable=True, default='', comment='创建者')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
||||
update_by = Column(String(64), nullable=True, default='', comment='更新者')
|
||||
update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
|
||||
remark = Column(String(500), nullable=True, default='', comment='备注')
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint('dict_type', name='uq_sys_dict_type_dict_type'),
|
||||
)
|
||||
|
||||
|
||||
class SysDictData(Base):
|
||||
"""
|
||||
字典数据表
|
||||
"""
|
||||
__tablename__ = 'sys_dict_data'
|
||||
|
||||
dict_code = Column(Integer, primary_key=True, autoincrement=True, comment='字典编码')
|
||||
dict_sort = Column(Integer, nullable=True, default=0, comment='字典排序')
|
||||
dict_label = Column(String(100), nullable=True, default='', comment='字典标签')
|
||||
dict_value = Column(String(100), nullable=True, default='', comment='字典键值')
|
||||
dict_type = Column(String(100), nullable=True, default='', comment='字典类型')
|
||||
css_class = Column(String(100), nullable=True, default='', comment='样式属性(其他样式扩展)')
|
||||
list_class = Column(String(100), nullable=True, default='', comment='表格回显样式')
|
||||
is_default = Column(String(1), nullable=True, default='N', comment='是否默认(Y是 N否)')
|
||||
status = Column(String(1), nullable=True, default='0', comment='状态(0正常 1停用)')
|
||||
create_by = Column(String(64), nullable=True, default='', comment='创建者')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
||||
update_by = Column(String(64), nullable=True, default='', comment='更新者')
|
||||
update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
|
||||
remark = Column(String(500), nullable=True, default='', comment='备注')
|
47
ruoyi-fastapi-backend/module_admin/entity/do/job_do.py
Normal file
47
ruoyi-fastapi-backend/module_admin/entity/do/job_do.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysJob(Base):
|
||||
"""
|
||||
定时任务调度表
|
||||
"""
|
||||
__tablename__ = 'sys_job'
|
||||
|
||||
job_id = Column(Integer, primary_key=True, autoincrement=True, comment='任务ID')
|
||||
job_name = Column(String(64, collation='utf8_general_ci'), nullable=False, comment='任务名称')
|
||||
job_group = Column(String(64, collation='utf8_general_ci'), nullable=False, default='default', comment='任务组名')
|
||||
job_executor = Column(String(64, collation='utf8_general_ci'), nullable=False, default='default', comment='任务执行器')
|
||||
invoke_target = Column(String(500, collation='utf8_general_ci'), nullable=False, comment='调用目标字符串')
|
||||
job_args = Column(String(255, collation='utf8_general_ci'), nullable=True, comment='位置参数')
|
||||
job_kwargs = Column(String(255, collation='utf8_general_ci'), nullable=True, comment='关键字参数')
|
||||
cron_expression = Column(String(255, collation='utf8_general_ci'), nullable=True, default='', comment='cron执行表达式')
|
||||
misfire_policy = Column(String(20, collation='utf8_general_ci'), nullable=True, default='3', comment='计划执行错误策略(1立即执行 2执行一次 3放弃执行)')
|
||||
concurrent = Column(String(1, collation='utf8_general_ci'), nullable=True, default='1', comment='是否并发执行(0允许 1禁止)')
|
||||
status = Column(String(1, collation='utf8_general_ci'), nullable=True, default='0', comment='状态(0正常 1暂停)')
|
||||
create_by = Column(String(64, collation='utf8_general_ci'), nullable=True, default='', comment='创建者')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
||||
update_by = Column(String(64, collation='utf8_general_ci'), nullable=True, default='', comment='更新者')
|
||||
update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
|
||||
remark = Column(String(500, collation='utf8_general_ci'), nullable=True, default='', comment='备注信息')
|
||||
|
||||
|
||||
class SysJobLog(Base):
|
||||
"""
|
||||
定时任务调度日志表
|
||||
"""
|
||||
__tablename__ = 'sys_job_log'
|
||||
|
||||
job_log_id = Column(Integer, primary_key=True, autoincrement=True, comment='任务日志ID')
|
||||
job_name = Column(String(64, collation='utf8_general_ci'), nullable=False, comment='任务名称')
|
||||
job_group = Column(String(64, collation='utf8_general_ci'), nullable=False, comment='任务组名')
|
||||
job_executor = Column(String(64, collation='utf8_general_ci'), nullable=False, default='default', comment='任务执行器')
|
||||
invoke_target = Column(String(500, collation='utf8_general_ci'), nullable=False, comment='调用目标字符串')
|
||||
job_args = Column(String(255, collation='utf8_general_ci'), nullable=True, comment='位置参数')
|
||||
job_kwargs = Column(String(255, collation='utf8_general_ci'), nullable=True, comment='关键字参数')
|
||||
job_trigger = Column(String(255, collation='utf8_general_ci'), nullable=True, comment='任务触发器')
|
||||
job_message = Column(String(500, collation='utf8_general_ci'), nullable=True, default='', comment='日志信息')
|
||||
status = Column(String(1, collation='utf8_general_ci'), nullable=True, default='0', comment='执行状态(0正常 1失败)')
|
||||
exception_info = Column(String(2000, collation='utf8_general_ci'), nullable=True, default='', comment='异常信息')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
52
ruoyi-fastapi-backend/module_admin/entity/do/log_do.py
Normal file
52
ruoyi-fastapi-backend/module_admin/entity/do/log_do.py
Normal file
@@ -0,0 +1,52 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, Text, BigInteger, Index
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysLogininfor(Base):
|
||||
"""
|
||||
系统访问记录
|
||||
"""
|
||||
__tablename__ = 'sys_logininfor'
|
||||
|
||||
info_id = Column(Integer, primary_key=True, autoincrement=True, comment='访问ID')
|
||||
user_name = Column(String(50, collation='utf8_general_ci'), nullable=True, default='', comment='用户账号')
|
||||
ipaddr = Column(String(128, collation='utf8_general_ci'), nullable=True, default='', comment='登录IP地址')
|
||||
login_location = Column(String(255, collation='utf8_general_ci'), nullable=True, default='', comment='登录地点')
|
||||
browser = Column(String(50, collation='utf8_general_ci'), nullable=True, default='', comment='浏览器类型')
|
||||
os = Column(String(50, collation='utf8_general_ci'), nullable=True, default='', comment='操作系统')
|
||||
status = Column(String(1, collation='utf8_general_ci'), nullable=True, default='0', comment='登录状态(0成功 1失败)')
|
||||
msg = Column(String(255, collation='utf8_general_ci'), nullable=True, default='', comment='提示消息')
|
||||
login_time = Column(DateTime, nullable=True, default=datetime.now(), comment='访问时间')
|
||||
|
||||
idx_sys_logininfor_s = Index('idx_sys_logininfor_s', status)
|
||||
idx_sys_logininfor_lt = Index('idx_sys_logininfor_lt', login_time)
|
||||
|
||||
|
||||
class SysOperLog(Base):
|
||||
"""
|
||||
操作日志记录
|
||||
"""
|
||||
__tablename__ = 'sys_oper_log'
|
||||
|
||||
oper_id = Column(BigInteger, primary_key=True, autoincrement=True, comment='日志主键')
|
||||
title = Column(String(50, collation='utf8_general_ci'), nullable=True, default='', comment='模块标题')
|
||||
business_type = Column(Integer, default=0, comment='业务类型(0其它 1新增 2修改 3删除)')
|
||||
method = Column(String(100, collation='utf8_general_ci'), nullable=True, default='', comment='方法名称')
|
||||
request_method = Column(String(10, collation='utf8_general_ci'), nullable=True, default='', comment='请求方式')
|
||||
operator_type = Column(Integer, default=0, comment='操作类别(0其它 1后台用户 2手机端用户)')
|
||||
oper_name = Column(String(50, collation='utf8_general_ci'), nullable=True, default='', comment='操作人员')
|
||||
dept_name = Column(String(50, collation='utf8_general_ci'), nullable=True, default='', comment='部门名称')
|
||||
oper_url = Column(String(255, collation='utf8_general_ci'), nullable=True, default='', comment='请求URL')
|
||||
oper_ip = Column(String(128, collation='utf8_general_ci'), nullable=True, default='', comment='主机地址')
|
||||
oper_location = Column(String(255, collation='utf8_general_ci'), nullable=True, default='', comment='操作地点')
|
||||
oper_param = Column(String(2000, collation='utf8_general_ci'), nullable=True, default='', comment='请求参数')
|
||||
json_result = Column(String(2000, collation='utf8_general_ci'), nullable=True, default='', comment='返回参数')
|
||||
status = Column(Integer, default=0, comment='操作状态(0正常 1异常)')
|
||||
error_msg = Column(String(2000, collation='utf8_general_ci'), nullable=True, default='', comment='错误消息')
|
||||
oper_time = Column(DateTime, nullable=True, default=datetime.now(), comment='操作时间')
|
||||
cost_time = Column(BigInteger, default=0, comment='消耗时间')
|
||||
|
||||
idx_sys_oper_log_bt = Index('idx_sys_oper_log_bt', business_type)
|
||||
idx_sys_oper_log_s = Index('idx_sys_oper_log_s', status)
|
||||
idx_sys_oper_log_ot = Index('idx_sys_oper_log_ot', oper_time)
|
30
ruoyi-fastapi-backend/module_admin/entity/do/menu_do.py
Normal file
30
ruoyi-fastapi-backend/module_admin/entity/do/menu_do.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysMenu(Base):
|
||||
"""
|
||||
菜单权限表
|
||||
"""
|
||||
__tablename__ = 'sys_menu'
|
||||
|
||||
menu_id = Column(Integer, primary_key=True, autoincrement=True, comment='菜单ID')
|
||||
menu_name = Column(String(50), nullable=False, default='', comment='菜单名称')
|
||||
parent_id = Column(Integer, default=0, comment='父菜单ID')
|
||||
order_num = Column(Integer, default=0, comment='显示顺序')
|
||||
path = Column(String(200), nullable=True, default='', comment='路由地址')
|
||||
component = Column(String(255), nullable=True, default=None, comment='组件路径')
|
||||
query = Column(String(255), nullable=True, default=None, comment='路由参数')
|
||||
is_frame = Column(Integer, default=1, comment='是否为外链(0是 1否)')
|
||||
is_cache = Column(Integer, default=0, comment='是否缓存(0缓存 1不缓存)')
|
||||
menu_type = Column(String(1), nullable=True, default='', comment='菜单类型(M目录 C菜单 F按钮)')
|
||||
visible = Column(String(1), nullable=True, default='0', comment='菜单状态(0显示 1隐藏)')
|
||||
status = Column(String(1), nullable=True, default='0', comment='菜单状态(0正常 1停用)')
|
||||
perms = Column(String(100), nullable=True, default=None, comment='权限标识')
|
||||
icon = Column(String(100), nullable=True, default='#', comment='菜单图标')
|
||||
create_by = Column(String(64), nullable=True, default='', comment='创建者')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
||||
update_by = Column(String(64), nullable=True, default='', comment='更新者')
|
||||
update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
|
||||
remark = Column(String(500), nullable=True, default='', comment='备注')
|
21
ruoyi-fastapi-backend/module_admin/entity/do/notice_do.py
Normal file
21
ruoyi-fastapi-backend/module_admin/entity/do/notice_do.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, LargeBinary
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysNotice(Base):
|
||||
"""
|
||||
通知公告表
|
||||
"""
|
||||
__tablename__ = 'sys_notice'
|
||||
|
||||
notice_id = Column(Integer, primary_key=True, autoincrement=True, comment='公告ID')
|
||||
notice_title = Column(String(50, collation='utf8_general_ci'), nullable=False, comment='公告标题')
|
||||
notice_type = Column(String(1, collation='utf8_general_ci'), nullable=False, comment='公告类型(1通知 2公告)')
|
||||
notice_content = Column(LargeBinary, comment='公告内容')
|
||||
status = Column(String(1, collation='utf8_general_ci'), default='0', comment='公告状态(0正常 1关闭)')
|
||||
create_by = Column(String(64, collation='utf8_general_ci'), default='', comment='创建者')
|
||||
create_time = Column(DateTime, comment='创建时间', default=datetime.now())
|
||||
update_by = Column(String(64, collation='utf8_general_ci'), default='', comment='更新者')
|
||||
update_time = Column(DateTime, comment='更新时间', default=datetime.now())
|
||||
remark = Column(String(255, collation='utf8_general_ci'), comment='备注')
|
21
ruoyi-fastapi-backend/module_admin/entity/do/post_do.py
Normal file
21
ruoyi-fastapi-backend/module_admin/entity/do/post_do.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysPost(Base):
|
||||
"""
|
||||
岗位信息表
|
||||
"""
|
||||
__tablename__ = 'sys_post'
|
||||
|
||||
post_id = Column(Integer, primary_key=True, autoincrement=True, comment='岗位ID')
|
||||
post_code = Column(String(64), nullable=False, comment='岗位编码')
|
||||
post_name = Column(String(50), nullable=False, comment='岗位名称')
|
||||
post_sort = Column(Integer, nullable=False, comment='显示顺序')
|
||||
status = Column(String(1), nullable=False, default='0', comment='状态(0正常 1停用)')
|
||||
create_by = Column(String(64), default='', comment='创建者')
|
||||
create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
|
||||
update_by = Column(String(64), default='', comment='更新者')
|
||||
update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
|
||||
remark = Column(String(500), nullable=True, default='', comment='备注')
|
45
ruoyi-fastapi-backend/module_admin/entity/do/role_do.py
Normal file
45
ruoyi-fastapi-backend/module_admin/entity/do/role_do.py
Normal 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')
|
50
ruoyi-fastapi-backend/module_admin/entity/do/user_do.py
Normal file
50
ruoyi-fastapi-backend/module_admin/entity/do/user_do.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from config.database import Base
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SysUser(Base):
|
||||
"""
|
||||
用户信息表
|
||||
"""
|
||||
__tablename__ = 'sys_user'
|
||||
|
||||
user_id = Column(Integer, primary_key=True, autoincrement=True, comment='用户ID')
|
||||
dept_id = Column(Integer, comment='部门ID')
|
||||
user_name = Column(String(30, collation='utf8_general_ci'), nullable=False, comment='用户账号')
|
||||
nick_name = Column(String(30, collation='utf8_general_ci'), nullable=False, comment='用户昵称')
|
||||
user_type = Column(String(2, collation='utf8_general_ci'), default='00', comment='用户类型(00系统用户)')
|
||||
email = Column(String(50, collation='utf8_general_ci'), default='', comment='用户邮箱')
|
||||
phonenumber = Column(String(11, collation='utf8_general_ci'), default='', comment='手机号码')
|
||||
sex = Column(String(1, collation='utf8_general_ci'), default='0', comment='用户性别(0男 1女 2未知)')
|
||||
avatar = Column(String(100, collation='utf8_general_ci'), default='', comment='头像地址')
|
||||
password = Column(String(100, collation='utf8_general_ci'), default='', comment='密码')
|
||||
status = Column(String(1, collation='utf8_general_ci'), default='0', comment='帐号状态(0正常 1停用)')
|
||||
del_flag = Column(String(1, collation='utf8_general_ci'), default='0', comment='删除标志(0代表存在 2代表删除)')
|
||||
login_ip = Column(String(128, collation='utf8_general_ci'), default='', comment='最后登录IP')
|
||||
login_date = Column(DateTime, comment='最后登录时间')
|
||||
create_by = Column(String(64, collation='utf8_general_ci'), default='', comment='创建者')
|
||||
create_time = Column(DateTime, comment='创建时间', default=datetime.now())
|
||||
update_by = Column(String(64, collation='utf8_general_ci'), default='', comment='更新者')
|
||||
update_time = Column(DateTime, comment='更新时间', default=datetime.now())
|
||||
remark = Column(String(500, collation='utf8_general_ci'), comment='备注')
|
||||
|
||||
|
||||
class SysUserRole(Base):
|
||||
"""
|
||||
用户和角色关联表
|
||||
"""
|
||||
__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):
|
||||
"""
|
||||
用户与岗位关联表
|
||||
"""
|
||||
__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')
|
26
ruoyi-fastapi-backend/module_admin/entity/vo/cache_vo.py
Normal file
26
ruoyi-fastapi-backend/module_admin/entity/vo/cache_vo.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Optional, List, Any
|
||||
|
||||
|
||||
class CacheMonitorModel(BaseModel):
|
||||
"""
|
||||
缓存监控信息对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
command_stats: Optional[List] = []
|
||||
db_size: Optional[int] = None
|
||||
info: Optional[dict] = {}
|
||||
|
||||
|
||||
class CacheInfoModel(BaseModel):
|
||||
"""
|
||||
缓存监控对象对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
cache_key: Optional[str] = None
|
||||
cache_name: Optional[str] = None
|
||||
cache_value: Optional[Any] = None
|
||||
remark: Optional[str] = None
|
@@ -0,0 +1,9 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class CrudResponseModel(BaseModel):
|
||||
"""
|
||||
操作响应模型
|
||||
"""
|
||||
is_success: bool
|
||||
message: str
|
50
ruoyi-fastapi-backend/module_admin/entity/vo/config_vo.py
Normal file
50
ruoyi-fastapi-backend/module_admin/entity/vo/config_vo.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class ConfigModel(BaseModel):
|
||||
"""
|
||||
参数配置表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
config_id: Optional[int] = None
|
||||
config_name: Optional[str] = None
|
||||
config_key: Optional[str] = None
|
||||
config_value: Optional[str] = None
|
||||
config_type: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class ConfigQueryModel(ConfigModel):
|
||||
"""
|
||||
参数配置管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class ConfigPageQueryModel(ConfigQueryModel):
|
||||
"""
|
||||
参数配置管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeleteConfigModel(BaseModel):
|
||||
"""
|
||||
删除参数配置模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
config_ids: str
|
47
ruoyi-fastapi-backend/module_admin/entity/vo/dept_vo.py
Normal file
47
ruoyi-fastapi-backend/module_admin/entity/vo/dept_vo.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query
|
||||
|
||||
|
||||
class DeptModel(BaseModel):
|
||||
"""
|
||||
部门表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
dept_id: Optional[int] = None
|
||||
parent_id: Optional[int] = None
|
||||
ancestors: Optional[str] = None
|
||||
dept_name: Optional[str] = None
|
||||
order_num: Optional[int] = None
|
||||
leader: Optional[str] = None
|
||||
phone: Optional[str] = None
|
||||
email: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
del_flag: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
|
||||
|
||||
@as_query
|
||||
class DeptQueryModel(DeptModel):
|
||||
"""
|
||||
部门管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
class DeleteDeptModel(BaseModel):
|
||||
"""
|
||||
删除部门模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
dept_ids: str
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[str] = None
|
98
ruoyi-fastapi-backend/module_admin/entity/vo/dict_vo.py
Normal file
98
ruoyi-fastapi-backend/module_admin/entity/vo/dict_vo.py
Normal file
@@ -0,0 +1,98 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class DictTypeModel(BaseModel):
|
||||
"""
|
||||
字典类型表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
dict_id: Optional[int] = None
|
||||
dict_name: Optional[str] = None
|
||||
dict_type: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class DictDataModel(BaseModel):
|
||||
"""
|
||||
字典数据表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
dict_code: Optional[int] = None
|
||||
dict_sort: Optional[int] = None
|
||||
dict_label: Optional[str] = None
|
||||
dict_value: Optional[str] = None
|
||||
dict_type: Optional[str] = None
|
||||
css_class: Optional[str] = None
|
||||
list_class: Optional[str] = None
|
||||
is_default: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class DictTypeQueryModel(DictTypeModel):
|
||||
"""
|
||||
字典类型管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class DictTypePageQueryModel(DictTypeQueryModel):
|
||||
"""
|
||||
字典类型管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeleteDictTypeModel(BaseModel):
|
||||
"""
|
||||
删除字典类型模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
dict_ids: str
|
||||
|
||||
|
||||
class DictDataQueryModel(DictTypeModel):
|
||||
"""
|
||||
字典数据管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class DictDataPageQueryModel(DictDataQueryModel):
|
||||
"""
|
||||
字典数据管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeleteDictDataModel(BaseModel):
|
||||
"""
|
||||
删除字典数据模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
dict_codes: str
|
110
ruoyi-fastapi-backend/module_admin/entity/vo/job_vo.py
Normal file
110
ruoyi-fastapi-backend/module_admin/entity/vo/job_vo.py
Normal file
@@ -0,0 +1,110 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class JobModel(BaseModel):
|
||||
"""
|
||||
定时任务调度表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
job_id: Optional[int] = None
|
||||
job_name: Optional[str] = None
|
||||
job_group: Optional[str] = None
|
||||
job_executor: Optional[str] = None
|
||||
invoke_target: Optional[str] = None
|
||||
job_args: Optional[str] = None
|
||||
job_kwargs: Optional[str] = None
|
||||
cron_expression: Optional[str] = None
|
||||
misfire_policy: Optional[str] = None
|
||||
concurrent: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class JobLogModel(BaseModel):
|
||||
"""
|
||||
定时任务调度日志表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
job_log_id: Optional[int] = None
|
||||
job_name: Optional[str] = None
|
||||
job_group: Optional[str] = None
|
||||
job_executor: Optional[str] = None
|
||||
invoke_target: Optional[str] = None
|
||||
job_args: Optional[str] = None
|
||||
job_kwargs: Optional[str] = None
|
||||
job_trigger: Optional[str] = None
|
||||
job_message: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
exception_info: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
|
||||
|
||||
class JobQueryModel(JobModel):
|
||||
"""
|
||||
定时任务管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class JobPageQueryModel(JobQueryModel):
|
||||
"""
|
||||
定时任务管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class EditJobModel(JobModel):
|
||||
"""
|
||||
编辑定时任务模型
|
||||
"""
|
||||
type: Optional[str] = None
|
||||
|
||||
|
||||
class DeleteJobModel(BaseModel):
|
||||
"""
|
||||
删除定时任务模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
job_ids: str
|
||||
|
||||
|
||||
class JobLogQueryModel(JobLogModel):
|
||||
"""
|
||||
定时任务日志不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class JobLogPageQueryModel(JobLogQueryModel):
|
||||
"""
|
||||
定时任务日志管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeleteJobLogModel(BaseModel):
|
||||
"""
|
||||
删除定时任务日志模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
job_log_ids: str
|
111
ruoyi-fastapi-backend/module_admin/entity/vo/log_vo.py
Normal file
111
ruoyi-fastapi-backend/module_admin/entity/vo/log_vo.py
Normal file
@@ -0,0 +1,111 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class OperLogModel(BaseModel):
|
||||
"""
|
||||
操作日志表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
oper_id: Optional[int] = None
|
||||
title: Optional[str] = None
|
||||
business_type: Optional[int] = None
|
||||
method: Optional[str] = None
|
||||
request_method: Optional[str] = None
|
||||
operator_type: Optional[int] = None
|
||||
oper_name: Optional[str] = None
|
||||
dept_name: Optional[str] = None
|
||||
oper_url: Optional[str] = None
|
||||
oper_ip: Optional[str] = None
|
||||
oper_location: Optional[str] = None
|
||||
oper_param: Optional[str] = None
|
||||
json_result: Optional[str] = None
|
||||
status: Optional[int] = None
|
||||
error_msg: Optional[str] = None
|
||||
oper_time: Optional[datetime] = None
|
||||
cost_time: Optional[int] = None
|
||||
|
||||
|
||||
class LogininforModel(BaseModel):
|
||||
"""
|
||||
登录日志表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
info_id: Optional[int] = None
|
||||
user_name: Optional[str] = None
|
||||
ipaddr: Optional[str] = None
|
||||
login_location: Optional[str] = None
|
||||
browser: Optional[str] = None
|
||||
os: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
msg: Optional[str] = None
|
||||
login_time: Optional[datetime] = None
|
||||
|
||||
|
||||
class OperLogQueryModel(OperLogModel):
|
||||
"""
|
||||
操作日志管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class OperLogPageQueryModel(OperLogQueryModel):
|
||||
"""
|
||||
操作日志管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeleteOperLogModel(BaseModel):
|
||||
"""
|
||||
删除操作日志模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
oper_ids: str
|
||||
|
||||
|
||||
class LoginLogQueryModel(LogininforModel):
|
||||
"""
|
||||
登录日志管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class LoginLogPageQueryModel(LoginLogQueryModel):
|
||||
"""
|
||||
登录日志管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeleteLoginLogModel(BaseModel):
|
||||
"""
|
||||
删除登录日志模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
info_ids: str
|
||||
|
||||
|
||||
class UnlockUser(BaseModel):
|
||||
"""
|
||||
解锁用户模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
user_name: str
|
34
ruoyi-fastapi-backend/module_admin/entity/vo/login_vo.py
Normal file
34
ruoyi-fastapi-backend/module_admin/entity/vo/login_vo.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class UserLogin(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
user_name: str
|
||||
password: str
|
||||
code: Optional[str] = None
|
||||
uuid: Optional[str] = None
|
||||
login_info: Optional[dict] = None
|
||||
captcha_enabled: Optional[bool] = None
|
||||
|
||||
|
||||
class Token(BaseModel):
|
||||
access_token: str
|
||||
token_type: str
|
||||
|
||||
|
||||
class CaptchaCode(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
captcha_enabled: bool
|
||||
img: str
|
||||
uuid: str
|
||||
|
||||
|
||||
class SmsCode(BaseModel):
|
||||
is_success: Optional[bool] = None
|
||||
sms_code: str
|
||||
session_id: str
|
||||
message: Optional[str] = None
|
50
ruoyi-fastapi-backend/module_admin/entity/vo/menu_vo.py
Normal file
50
ruoyi-fastapi-backend/module_admin/entity/vo/menu_vo.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from datetime import datetime
|
||||
from typing import Union, Optional, List
|
||||
from module_admin.annotation.pydantic_annotation import as_query
|
||||
|
||||
|
||||
class MenuModel(BaseModel):
|
||||
"""
|
||||
菜单表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
menu_id: Optional[int] = None
|
||||
menu_name: Optional[str] = None
|
||||
parent_id: Optional[int] = None
|
||||
order_num: Optional[int] = None
|
||||
path: Optional[str] = None
|
||||
component: Optional[str] = None
|
||||
query: Optional[str] = None
|
||||
is_frame: Optional[int] = None
|
||||
is_cache: Optional[int] = None
|
||||
menu_type: Optional[str] = None
|
||||
visible: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
perms: Optional[str] = None
|
||||
icon: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
class MenuQueryModel(MenuModel):
|
||||
"""
|
||||
菜单管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
class DeleteMenuModel(BaseModel):
|
||||
"""
|
||||
删除菜单模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
menu_ids: str
|
50
ruoyi-fastapi-backend/module_admin/entity/vo/notice_vo.py
Normal file
50
ruoyi-fastapi-backend/module_admin/entity/vo/notice_vo.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class NoticeModel(BaseModel):
|
||||
"""
|
||||
通知公告表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
notice_id: Optional[int] = None
|
||||
notice_title: Optional[str] = None
|
||||
notice_type: Optional[str] = None
|
||||
notice_content: Optional[bytes] = None
|
||||
status: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class NoticeQueryModel(NoticeModel):
|
||||
"""
|
||||
通知公告管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class NoticePageQueryModel(NoticeQueryModel):
|
||||
"""
|
||||
通知公告管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeleteNoticeModel(BaseModel):
|
||||
"""
|
||||
删除通知公告模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
notice_ids: str
|
39
ruoyi-fastapi-backend/module_admin/entity/vo/online_vo.py
Normal file
39
ruoyi-fastapi-backend/module_admin/entity/vo/online_vo.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query
|
||||
|
||||
|
||||
class OnlineModel(BaseModel):
|
||||
"""
|
||||
在线用户对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
token_id: Optional[str] = None
|
||||
user_name: Optional[str] = None
|
||||
dept_name: Optional[str] = None
|
||||
ipaddr: Optional[str] = None
|
||||
login_location: Optional[str] = None
|
||||
browser: Optional[str] = None
|
||||
os: Optional[str] = None
|
||||
login_time: Optional[datetime] = None
|
||||
|
||||
|
||||
@as_query
|
||||
class OnlineQueryModel(OnlineModel):
|
||||
"""
|
||||
岗位管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
class DeleteOnlineModel(BaseModel):
|
||||
"""
|
||||
强退在线用户模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
token_ids: str
|
50
ruoyi-fastapi-backend/module_admin/entity/vo/post_vo.py
Normal file
50
ruoyi-fastapi-backend/module_admin/entity/vo/post_vo.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class PostModel(BaseModel):
|
||||
"""
|
||||
岗位信息表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
post_id: Optional[int] = None
|
||||
post_code: Optional[str] = None
|
||||
post_name: Optional[str] = None
|
||||
post_sort: Optional[int] = None
|
||||
status: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class PostQueryModel(PostModel):
|
||||
"""
|
||||
岗位管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class PostPageQueryModel(PostQueryModel):
|
||||
"""
|
||||
岗位管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DeletePostModel(BaseModel):
|
||||
"""
|
||||
删除岗位模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
post_ids: str
|
127
ruoyi-fastapi-backend/module_admin/entity/vo/role_vo.py
Normal file
127
ruoyi-fastapi-backend/module_admin/entity/vo/role_vo.py
Normal file
@@ -0,0 +1,127 @@
|
||||
from pydantic import BaseModel, ConfigDict, field_validator, model_validator
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class RoleModel(BaseModel):
|
||||
"""
|
||||
角色表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
role_id: Optional[int] = None
|
||||
role_name: Optional[str] = None
|
||||
role_key: Optional[str] = None
|
||||
role_sort: Optional[int] = None
|
||||
data_scope: Optional[str] = None
|
||||
menu_check_strictly: Optional[Union[int, bool]] = None
|
||||
dept_check_strictly: Optional[Union[int, bool]] = None
|
||||
status: Optional[str] = None
|
||||
del_flag: Optional[str] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
admin: Optional[bool] = False
|
||||
|
||||
@field_validator('menu_check_strictly', 'dept_check_strictly')
|
||||
@classmethod
|
||||
def check_filed_mapping(cls, v: Union[int, bool]) -> Union[int, bool]:
|
||||
if v == 1:
|
||||
v = True
|
||||
elif v == 0:
|
||||
v = False
|
||||
elif v is True:
|
||||
v = 1
|
||||
elif v is False:
|
||||
v = 0
|
||||
return v
|
||||
|
||||
@model_validator(mode='after')
|
||||
def check_admin(self) -> 'RoleModel':
|
||||
if self.role_id == 1:
|
||||
self.admin = True
|
||||
else:
|
||||
self.admin = False
|
||||
return self
|
||||
|
||||
|
||||
class RoleMenuModel(BaseModel):
|
||||
"""
|
||||
角色和菜单关联表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
role_id: Optional[int] = None
|
||||
menu_id: Optional[int] = None
|
||||
|
||||
|
||||
class RoleDeptModel(BaseModel):
|
||||
"""
|
||||
角色和部门关联表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
role_id: Optional[int] = None
|
||||
dept_id: Optional[int] = None
|
||||
|
||||
|
||||
class RoleQueryModel(RoleModel):
|
||||
"""
|
||||
角色管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class RolePageQueryModel(RoleQueryModel):
|
||||
"""
|
||||
角色管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class RoleMenuQueryModel(BaseModel):
|
||||
"""
|
||||
角色菜单查询模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
menus: List = []
|
||||
checked_keys: List[int] = []
|
||||
|
||||
|
||||
class RoleDeptQueryModel(BaseModel):
|
||||
"""
|
||||
角色部门查询模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
depts: List = []
|
||||
checked_keys: List[int] = []
|
||||
|
||||
|
||||
class AddRoleModel(RoleModel):
|
||||
"""
|
||||
新增角色模型
|
||||
"""
|
||||
dept_ids: List = []
|
||||
menu_ids: List = []
|
||||
type: Optional[str] = None
|
||||
|
||||
|
||||
class DeleteRoleModel(BaseModel):
|
||||
"""
|
||||
删除角色模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
role_ids: str
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
66
ruoyi-fastapi-backend/module_admin/entity/vo/server_vo.py
Normal file
66
ruoyi-fastapi-backend/module_admin/entity/vo/server_vo.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Optional, List
|
||||
|
||||
|
||||
class CpuInfo(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
cpu_num: Optional[int] = None
|
||||
used: Optional[float] = None
|
||||
sys: Optional[float] = None
|
||||
free: Optional[float] = None
|
||||
|
||||
|
||||
class MemoryInfo(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
total: Optional[str] = None
|
||||
used: Optional[str] = None
|
||||
free: Optional[str] = None
|
||||
usage: Optional[float] = None
|
||||
|
||||
|
||||
class SysInfo(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
computer_ip: Optional[str] = None
|
||||
computer_name: Optional[str] = None
|
||||
os_arch: Optional[str] = None
|
||||
os_name: Optional[str] = None
|
||||
user_dir: Optional[str] = None
|
||||
|
||||
|
||||
class PyInfo(MemoryInfo):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
name: Optional[str] = None
|
||||
version: Optional[str] = None
|
||||
start_time: Optional[str] = None
|
||||
run_time: Optional[str] = None
|
||||
home: Optional[str] = None
|
||||
|
||||
|
||||
class SysFiles(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
dir_name: Optional[str] = None
|
||||
sys_type_name: Optional[str] = None
|
||||
type_name: Optional[str] = None
|
||||
total: Optional[str] = None
|
||||
used: Optional[str] = None
|
||||
free: Optional[str] = None
|
||||
usage: Optional[str] = None
|
||||
|
||||
|
||||
class ServerMonitorModel(BaseModel):
|
||||
"""
|
||||
服务监控对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
cpu: Optional[CpuInfo]
|
||||
py: Optional[PyInfo]
|
||||
mem: Optional[MemoryInfo]
|
||||
sys: Optional[SysInfo]
|
||||
sys_files: Optional[List[SysFiles]]
|
210
ruoyi-fastapi-backend/module_admin/entity/vo/user_vo.py
Normal file
210
ruoyi-fastapi-backend/module_admin/entity/vo/user_vo.py
Normal file
@@ -0,0 +1,210 @@
|
||||
from pydantic import BaseModel, ConfigDict, model_validator
|
||||
from pydantic.alias_generators import to_camel
|
||||
from typing import Union, Optional, List
|
||||
from datetime import datetime
|
||||
from module_admin.entity.vo.role_vo import RoleModel
|
||||
from module_admin.entity.vo.dept_vo import DeptModel
|
||||
from module_admin.entity.vo.post_vo import PostModel
|
||||
from module_admin.annotation.pydantic_annotation import as_query, as_form
|
||||
|
||||
|
||||
class TokenData(BaseModel):
|
||||
"""
|
||||
token解析结果
|
||||
"""
|
||||
user_id: Union[int, None] = None
|
||||
|
||||
|
||||
class UserModel(BaseModel):
|
||||
"""
|
||||
用户表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
user_id: Optional[int] = None
|
||||
dept_id: Optional[int] = None
|
||||
user_name: Optional[str] = None
|
||||
nick_name: Optional[str] = None
|
||||
user_type: Optional[str] = None
|
||||
email: Optional[str] = None
|
||||
phonenumber: Optional[str] = None
|
||||
sex: Optional[str] = None
|
||||
avatar: Optional[str] = None
|
||||
password: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
del_flag: Optional[str] = None
|
||||
login_ip: Optional[str] = None
|
||||
login_date: Optional[datetime] = None
|
||||
create_by: Optional[str] = None
|
||||
create_time: Optional[datetime] = None
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
remark: Optional[str] = None
|
||||
admin: Optional[bool] = False
|
||||
|
||||
@model_validator(mode='after')
|
||||
def check_admin(self) -> 'UserModel':
|
||||
if self.user_id == 1:
|
||||
self.admin = True
|
||||
else:
|
||||
self.admin = False
|
||||
return self
|
||||
|
||||
|
||||
class UserRoleModel(BaseModel):
|
||||
"""
|
||||
用户和角色关联表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
user_id: Optional[int] = None
|
||||
role_id: Optional[int] = None
|
||||
|
||||
|
||||
class UserPostModel(BaseModel):
|
||||
"""
|
||||
用户与岗位关联表对应pydantic模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
user_id: Optional[int] = None
|
||||
post_id: Optional[int] = None
|
||||
|
||||
|
||||
class UserInfoModel(UserModel):
|
||||
post_ids: Optional[Union[str, None]] = None
|
||||
role_ids: Optional[Union[str, None]] = None
|
||||
dept: Optional[Union[DeptModel, None]] = None
|
||||
role: Optional[List[Union[RoleModel, None]]] = []
|
||||
|
||||
|
||||
class CurrentUserModel(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
permissions: List
|
||||
roles: List
|
||||
user: Union[UserInfoModel, None]
|
||||
|
||||
|
||||
class UserDetailModel(BaseModel):
|
||||
"""
|
||||
获取用户详情信息响应模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
data: Optional[Union[UserInfoModel, None]] = None
|
||||
post_ids: Optional[List] = None
|
||||
posts: List[Union[PostModel, None]]
|
||||
role_ids: Optional[List] = None
|
||||
roles: List[Union[RoleModel, None]]
|
||||
|
||||
|
||||
class UserProfileModel(BaseModel):
|
||||
"""
|
||||
获取个人信息响应模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
data: Union[UserInfoModel, None]
|
||||
post_group: Union[str, None]
|
||||
role_group: Union[str, None]
|
||||
|
||||
|
||||
class UserQueryModel(UserModel):
|
||||
"""
|
||||
用户管理不分页查询模型
|
||||
"""
|
||||
begin_time: Optional[str] = None
|
||||
end_time: Optional[str] = None
|
||||
|
||||
|
||||
@as_query
|
||||
@as_form
|
||||
class UserPageQueryModel(UserQueryModel):
|
||||
"""
|
||||
用户管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class AddUserModel(UserModel):
|
||||
"""
|
||||
新增用户模型
|
||||
"""
|
||||
role_ids: Optional[List] = []
|
||||
post_ids: Optional[List] = []
|
||||
type: Optional[str] = None
|
||||
|
||||
|
||||
class EditUserModel(AddUserModel):
|
||||
"""
|
||||
编辑用户模型
|
||||
"""
|
||||
role: Optional[List] = []
|
||||
|
||||
|
||||
class ResetUserModel(UserModel):
|
||||
"""
|
||||
重置用户密码模型
|
||||
"""
|
||||
old_password: Optional[str] = None
|
||||
sms_code: Optional[str] = None
|
||||
session_id: Optional[str] = None
|
||||
|
||||
|
||||
class DeleteUserModel(BaseModel):
|
||||
"""
|
||||
删除用户模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
user_ids: str
|
||||
update_by: Optional[str] = None
|
||||
update_time: Optional[datetime] = None
|
||||
|
||||
|
||||
class UserRoleQueryModel(UserModel):
|
||||
"""
|
||||
用户角色关联管理不分页查询模型
|
||||
"""
|
||||
role_id: Optional[int] = None
|
||||
|
||||
|
||||
@as_query
|
||||
class UserRolePageQueryModel(UserRoleQueryModel):
|
||||
"""
|
||||
用户角色关联管理分页查询模型
|
||||
"""
|
||||
page_num: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class SelectedRoleModel(RoleModel):
|
||||
"""
|
||||
是否选择角色模型
|
||||
"""
|
||||
flag: Optional[bool] = False
|
||||
|
||||
|
||||
class UserRoleResponseModel(BaseModel):
|
||||
"""
|
||||
用户角色关联管理列表返回模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
roles: List[Union[SelectedRoleModel, None]] = []
|
||||
user: UserInfoModel
|
||||
|
||||
|
||||
@as_query
|
||||
class CrudUserRoleModel(BaseModel):
|
||||
"""
|
||||
新增、删除用户关联角色及角色关联用户模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
user_id: Optional[int] = None
|
||||
user_ids: Optional[str] = None
|
||||
role_id: Optional[int] = None
|
||||
role_ids: Optional[str] = None
|
Reference in New Issue
Block a user