feat: 新增对PostgreSQL数据库的支持

This commit is contained in:
insistence
2024-10-22 16:27:47 +08:00
parent bb143ac15a
commit c7af974d3f
18 changed files with 1092 additions and 94 deletions

View File

@@ -11,15 +11,13 @@ 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='提示消息')
user_name = Column(String(50), nullable=True, default='', comment='用户账号')
ipaddr = Column(String(128), nullable=True, default='', comment='登录IP地址')
login_location = Column(String(255), nullable=True, default='', comment='登录地点')
browser = Column(String(50), nullable=True, default='', comment='浏览器类型')
os = Column(String(50), nullable=True, default='', comment='操作系统')
status = Column(String(1), nullable=True, default='0', comment='登录状态0成功 1失败')
msg = Column(String(255), nullable=True, default='', comment='提示消息')
login_time = Column(DateTime, nullable=True, default=datetime.now(), comment='访问时间')
idx_sys_logininfor_s = Index('idx_sys_logininfor_s', status)
@@ -34,20 +32,20 @@ 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='模块标题')
title = Column(String(50), 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='请求方式')
method = Column(String(100), nullable=True, default='', comment='方法名称')
request_method = Column(String(10), 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='返回参数')
oper_name = Column(String(50), nullable=True, default='', comment='操作人员')
dept_name = Column(String(50), nullable=True, default='', comment='部门名称')
oper_url = Column(String(255), nullable=True, default='', comment='请求URL')
oper_ip = Column(String(128), nullable=True, default='', comment='主机地址')
oper_location = Column(String(255), nullable=True, default='', comment='操作地点')
oper_param = Column(String(2000), nullable=True, default='', comment='请求参数')
json_result = Column(String(2000), 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='错误消息')
error_msg = Column(String(2000), nullable=True, default='', comment='错误消息')
oper_time = Column(DateTime, nullable=True, default=datetime.now(), comment='操作时间')
cost_time = Column(BigInteger, default=0, comment='消耗时间')