diff --git a/.image/javafx/API-访问日志1.png b/.image/javafx/API-访问日志1.png new file mode 100644 index 0000000..f6cd4e1 Binary files /dev/null and b/.image/javafx/API-访问日志1.png differ diff --git a/.image/javafx/API-访问日志2.png b/.image/javafx/API-访问日志2.png new file mode 100644 index 0000000..721a2b0 Binary files /dev/null and b/.image/javafx/API-访问日志2.png differ diff --git a/.image/javafx/API-访问日志3.png b/.image/javafx/API-访问日志3.png new file mode 100644 index 0000000..a6b02f3 Binary files /dev/null and b/.image/javafx/API-访问日志3.png differ diff --git a/.image/javafx/API-错误日志1.png b/.image/javafx/API-错误日志1.png new file mode 100644 index 0000000..0e4dab6 Binary files /dev/null and b/.image/javafx/API-错误日志1.png differ diff --git a/.image/javafx/API-错误日志2.png b/.image/javafx/API-错误日志2.png new file mode 100644 index 0000000..cfb3a82 Binary files /dev/null and b/.image/javafx/API-错误日志2.png differ diff --git a/.image/javafx/API-错误日志3.png b/.image/javafx/API-错误日志3.png new file mode 100644 index 0000000..2c3f978 Binary files /dev/null and b/.image/javafx/API-错误日志3.png differ diff --git a/.image/javafx/配置管理1.png b/.image/javafx/配置管理1.png new file mode 100644 index 0000000..39a1f16 Binary files /dev/null and b/.image/javafx/配置管理1.png differ diff --git a/.image/javafx/配置管理2.png b/.image/javafx/配置管理2.png new file mode 100644 index 0000000..ccf59f9 Binary files /dev/null and b/.image/javafx/配置管理2.png differ diff --git a/.image/javafx/配置管理3.png b/.image/javafx/配置管理3.png new file mode 100644 index 0000000..cd3467a Binary files /dev/null and b/.image/javafx/配置管理3.png differ diff --git a/.image/swing/API-访问日志1.png b/.image/swing/API-访问日志1.png new file mode 100644 index 0000000..d019755 Binary files /dev/null and b/.image/swing/API-访问日志1.png differ diff --git a/.image/swing/API-访问日志2.png b/.image/swing/API-访问日志2.png new file mode 100644 index 0000000..2303d66 Binary files /dev/null and b/.image/swing/API-访问日志2.png differ diff --git a/.image/swing/API-访问日志3.png b/.image/swing/API-访问日志3.png new file mode 100644 index 0000000..792aa2e Binary files /dev/null and b/.image/swing/API-访问日志3.png differ diff --git a/.image/swing/API-错误日志1.png b/.image/swing/API-错误日志1.png new file mode 100644 index 0000000..a5b90ea Binary files /dev/null and b/.image/swing/API-错误日志1.png differ diff --git a/.image/swing/API-错误日志2.png b/.image/swing/API-错误日志2.png new file mode 100644 index 0000000..c6b59ac Binary files /dev/null and b/.image/swing/API-错误日志2.png differ diff --git a/.image/swing/API-错误日志3.png b/.image/swing/API-错误日志3.png new file mode 100644 index 0000000..56d333a Binary files /dev/null and b/.image/swing/API-错误日志3.png differ diff --git a/.image/swing/配置管理1.png b/.image/swing/配置管理1.png new file mode 100644 index 0000000..9992649 Binary files /dev/null and b/.image/swing/配置管理1.png differ diff --git a/.image/swing/配置管理2.png b/.image/swing/配置管理2.png new file mode 100644 index 0000000..01f6088 Binary files /dev/null and b/.image/swing/配置管理2.png differ diff --git a/.image/swing/配置管理3.png b/.image/swing/配置管理3.png new file mode 100644 index 0000000..bacc011 Binary files /dev/null and b/.image/swing/配置管理3.png differ diff --git a/README.md b/README.md index 349ffce..af3a0aa 100644 --- a/README.md +++ b/README.md @@ -125,49 +125,55 @@ HTTP库:使用 OpenFeign HTTP库,该库提供了方便的 HTTP 请求和响 ### JavaFX -| 模块 | 浅色 | 深色 | glass | -|------|------------------------------------|------------------------------------|-----------------------------------| -| 登录 | ![登录](/.image/javafx/登录.png) | - | - | -| 主页 | ![主页](/.image/javafx/主页1.png) | ![主页](/.image/javafx/主页2.png) | ![主页](/.image/javafx/主页3.png) | -| 主页2 | ![主页2](/.image/javafx/主页21.png) | ![主页2](/.image/javafx/主页22.png) | ![主页2](/.image/javafx/主页23.png) | -| 用户管理 | ![用户管理](/.image/javafx/用户管理1.png) | ![用户管理](/.image/javafx/用户管理2.png) | ![用户管理](/.image/javafx/用户管理3.png) | -| 角色管理 | ![角色管理1](/.image/javafx/角色管理1.png) | ![角色管理2](/.image/javafx/角色管理2.png) | ![用户管理3](/.image/javafx/用户管理3.png) | -| 菜单管理 | ![菜单管理1](/.image/javafx/菜单管理1.png) | ![菜单管理2](/.image/javafx/菜单管理2.png) | ![菜单管理3](/.image/javafx/菜单管理3.png) | -| 部门管理 | ![部门管理](/.image/javafx/部门管理1.png) | ![部门管理](/.image/javafx/部门管理2.png) | ![部门管理](/.image/javafx/部门管理3.png) | -| 岗位管理 | ![岗位管理](/.image/javafx/岗位管理1.png) | ![岗位管理](/.image/javafx/岗位管理2.png) | ![岗位管理](/.image/javafx/岗位管理3.png) | -| 字典管理 | ![字典管理](/.image/javafx/字典管理1.png) | ![字典管理](/.image/javafx/字典管理2.png) | ![字典管理](/.image/javafx/字典管理3.png) | -| 字典数据 | ![字典数据](/.image/javafx/字典数据1.png) | ![字典数据](/.image/javafx/字典数据2.png) | ![字典数据](/.image/javafx/字典数据3.png) | -| 通知公告 | ![通知公告](/.image/javafx/通知公告1.png) | ![通知公告](/.image/javafx/通知公告2.png) | ![通知公告](/.image/javafx/通知公告3.png) | -| 消息模板 | ![消息模板](/.image/javafx/消息模板1.png) | ![消息模板](/.image/javafx/消息模板2.png) | ![消息模板](/.image/javafx/消息模板3.png) | -| 消息记录 | ![消息记录](/.image/javafx/消息记录1.png) | ![消息记录](/.image/javafx/消息记录2.png) | ![消息记录](/.image/javafx/消息记录3.png) | -| 我的消息 | ![我的消息](/.image/javafx/我的消息1.png) | ![我的消息](/.image/javafx/我的消息2.png) | ![我的消息](/.image/javafx/我的消息3.png) | -| 操作日志 | ![操作日志](/.image/javafx/操作日志1.png) | ![操作日志](/.image/javafx/操作日志2.png) | ![操作日志](/.image/javafx/操作日志3.png) | -| 登录日志 | ![登录日志](/.image/javafx/登录日志1.png) | ![登录日志](/.image/javafx/登录日志2.png) | ![登录日志](/.image/javafx/登录日志3.png) | -| 令牌管理 | ![令牌管理](/.image/javafx/令牌管理1.png) | ![令牌管理](/.image/javafx/令牌管理2.png) | ![令牌管理](/.image/javafx/令牌管理3.png) | -| 文件配置 | ![文件配置](/.image/javafx/文件配置1.png) | ![文件配置](/.image/javafx/文件配置2.png) | ![文件配置](/.image/javafx/文件配置3.png) | -| 文件列表 | ![文件列表](/.image/javafx/文件列表1.png) | ![文件列表](/.image/javafx/文件列表2.png) | ![文件列表](/.image/javafx/文件列表3.png) | -| 定时任务 | ![定时任务](/.image/javafx/定时任务1.png) | ![定时任务](/.image/javafx/定时任务2.png) | ![定时任务](/.image/javafx/定时任务3.png) | -| 执行日志 | ![执行日志](/.image/javafx/执行日志1.png) | ![执行日志](/.image/javafx/执行日志2.png) | ![执行日志](/.image/javafx/执行日志3.png) | +| 模块 | 浅色 | 深色 | glass | +|----------|-------------------------------------------|-------------------------------------------|-------------------------------------------| +| 登录 | ![登录](/.image/javafx/登录.png) | - | - | +| 主页 | ![主页](/.image/javafx/主页1.png) | ![主页](/.image/javafx/主页2.png) | ![主页](/.image/javafx/主页3.png) | +| 主页2 | ![主页2](/.image/javafx/主页21.png) | ![主页2](/.image/javafx/主页22.png) | ![主页2](/.image/javafx/主页23.png) | +| 用户管理 | ![用户管理](/.image/javafx/用户管理1.png) | ![用户管理](/.image/javafx/用户管理2.png) | ![用户管理](/.image/javafx/用户管理3.png) | +| 角色管理 | ![角色管理1](/.image/javafx/角色管理1.png) | ![角色管理2](/.image/javafx/角色管理2.png) | ![用户管理3](/.image/javafx/用户管理3.png) | +| 菜单管理 | ![菜单管理1](/.image/javafx/菜单管理1.png) | ![菜单管理2](/.image/javafx/菜单管理2.png) | ![菜单管理3](/.image/javafx/菜单管理3.png) | +| 部门管理 | ![部门管理](/.image/javafx/部门管理1.png) | ![部门管理](/.image/javafx/部门管理2.png) | ![部门管理](/.image/javafx/部门管理3.png) | +| 岗位管理 | ![岗位管理](/.image/javafx/岗位管理1.png) | ![岗位管理](/.image/javafx/岗位管理2.png) | ![岗位管理](/.image/javafx/岗位管理3.png) | +| 字典管理 | ![字典管理](/.image/javafx/字典管理1.png) | ![字典管理](/.image/javafx/字典管理2.png) | ![字典管理](/.image/javafx/字典管理3.png) | +| 字典数据 | ![字典数据](/.image/javafx/字典数据1.png) | ![字典数据](/.image/javafx/字典数据2.png) | ![字典数据](/.image/javafx/字典数据3.png) | +| 通知公告 | ![通知公告](/.image/javafx/通知公告1.png) | ![通知公告](/.image/javafx/通知公告2.png) | ![通知公告](/.image/javafx/通知公告3.png) | +| 消息模板 | ![消息模板](/.image/javafx/消息模板1.png) | ![消息模板](/.image/javafx/消息模板2.png) | ![消息模板](/.image/javafx/消息模板3.png) | +| 消息记录 | ![消息记录](/.image/javafx/消息记录1.png) | ![消息记录](/.image/javafx/消息记录2.png) | ![消息记录](/.image/javafx/消息记录3.png) | +| 我的消息 | ![我的消息](/.image/javafx/我的消息1.png) | ![我的消息](/.image/javafx/我的消息2.png) | ![我的消息](/.image/javafx/我的消息3.png) | +| 操作日志 | ![操作日志](/.image/javafx/操作日志1.png) | ![操作日志](/.image/javafx/操作日志2.png) | ![操作日志](/.image/javafx/操作日志3.png) | +| 登录日志 | ![登录日志](/.image/javafx/登录日志1.png) | ![登录日志](/.image/javafx/登录日志2.png) | ![登录日志](/.image/javafx/登录日志3.png) | +| 令牌管理 | ![令牌管理](/.image/javafx/令牌管理1.png) | ![令牌管理](/.image/javafx/令牌管理2.png) | ![令牌管理](/.image/javafx/令牌管理3.png) | +| 文件配置 | ![文件配置](/.image/javafx/文件配置1.png) | ![文件配置](/.image/javafx/文件配置2.png) | ![文件配置](/.image/javafx/文件配置3.png) | +| 文件列表 | ![文件列表](/.image/javafx/文件列表1.png) | ![文件列表](/.image/javafx/文件列表2.png) | ![文件列表](/.image/javafx/文件列表3.png) | +| 定时任务 | ![定时任务](/.image/javafx/定时任务1.png) | ![定时任务](/.image/javafx/定时任务2.png) | ![定时任务](/.image/javafx/定时任务3.png) | +| 执行日志 | ![执行日志](/.image/javafx/执行日志1.png) | ![执行日志](/.image/javafx/执行日志2.png) | ![执行日志](/.image/javafx/执行日志3.png) | +| API-访问日志 | ![API-访问日志](/.image/javafx/API-访问日志1.png) | ![API-访问日志](/.image/javafx/API-访问日志2.png) | ![API-访问日志](/.image/javafx/API-访问日志3.png) | +| API-错误日志 | ![API-错误日志](/.image/javafx/API-错误日志1.png) | ![API-错误日志](/.image/javafx/API-错误日志2.png) | ![API-错误日志](/.image/javafx/API-错误日志3.png) | +| 配置管理 | ![配置管理](/.image/javafx/配置管理1.png) | ![配置管理](/.image/javafx/配置管理2.png) | ![配置管理](/.image/javafx/配置管理3.png) | ### Java Swing -| 模块 | 浅色 | 深色1 | 深色2 | -|------|-----------------------------------|-----------------------------------|-----------------------------------| -| 登录 | ![登录](/.image/swing/登录.png) | - | - | -| 用户管理 | ![用户管理](/.image/swing/用户管理1.png) | ![用户管理](/.image/swing/用户管理2.png) | ![用户管理](/.image/swing/用户管理3.png) | -| 角色管理 | ![角色管理1](/.image/swing/角色管理1.png) | ![角色管理2](/.image/swing/角色管理2.png) | ![用户管理3](/.image/swing/用户管理3.png) | -| 菜单管理 | ![菜单管理1](/.image/swing/菜单管理1.png) | ![菜单管理2](/.image/swing/菜单管理2.png) | ![菜单管理3](/.image/swing/菜单管理3.png) | -| 部门管理 | ![部门管理](/.image/swing/部门管理1.png) | ![部门管理](/.image/swing/部门管理2.png) | ![部门管理](/.image/swing/部门管理3.png) | -| 岗位管理 | ![岗位管理](/.image/swing/岗位管理1.png) | ![岗位管理](/.image/swing/岗位管理2.png) | ![岗位管理](/.image/swing/岗位管理3.png) | -| 字典管理 | ![字典管理](/.image/swing/字典管理1.png) | ![字典管理](/.image/swing/字典管理2.png) | ![字典管理](/.image/swing/字典管理3.png) | -| 字典数据 | ![字典数据](/.image/swing/字典数据1.png) | ![字典数据](/.image/swing/字典数据2.png) | ![字典数据](/.image/swing/字典数据3.png) | -| 通知公告 | ![通知公告](/.image/swing/通知公告1.png) | ![字典数据](/.image/swing/通知公告2.png) | ![字典数据](/.image/swing/通知公告3.png) | -| 消息模板 | ![消息模板](/.image/swing/消息模板1.png) | ![消息模板](/.image/swing/消息模板2.png) | ![消息模板](/.image/swing/消息模板3.png) | -| 消息记录 | ![消息记录](/.image/swing/消息记录1.png) | ![消息记录](/.image/swing/消息记录2.png) | ![消息记录](/.image/swing/消息记录3.png) | -| 我的消息 | ![我的消息](/.image/swing/我的消息1.png) | ![我的消息](/.image/swing/我的消息2.png) | ![我的消息](/.image/swing/我的消息3.png) | -| 操作日志 | ![操作日志](/.image/swing/操作日志1.png) | ![操作日志](/.image/swing/操作日志2.png) | ![操作日志](/.image/swing/操作日志3.png) | -| 登录日志 | ![登录日志](/.image/swing/登录日志1.png) | ![登录日志](/.image/swing/登录日志2.png) | ![登录日志](/.image/swing/登录日志3.png) | -| 文件配置 | ![文件配置](/.image/swing/文件配置1.png) | ![文件配置](/.image/swing/文件配置2.png) | ![文件配置](/.image/swing/文件配置3.png) | -| 文件列表 | ![文件列表](/.image/swing/文件列表1.png) | ![文件列表](/.image/swing/文件列表2.png) | ![文件列表](/.image/swing/文件列表3.png) | -| 定时任务 | ![定时任务](/.image/swing/定时任务1.png) | ![定时任务](/.image/swing/定时任务2.png) | ![定时任务](/.image/swing/定时任务3.png) | -| 执行日志 | ![执行日志](/.image/swing/执行日志1.png) | ![执行日志](/.image/swing/执行日志2.png) | ![执行日志](/.image/swing/执行日志3.png) | +| 模块 | 浅色 | 深色1 | 深色2 | +|------|-------------------------------------------|-----------------------------------|-----------------------------------| +| 登录 | ![登录](/.image/swing/登录.png) | - | - | +| 用户管理 | ![用户管理](/.image/swing/用户管理1.png) | ![用户管理](/.image/swing/用户管理2.png) | ![用户管理](/.image/swing/用户管理3.png) | +| 角色管理 | ![角色管理1](/.image/swing/角色管理1.png) | ![角色管理2](/.image/swing/角色管理2.png) | ![用户管理3](/.image/swing/用户管理3.png) | +| 菜单管理 | ![菜单管理1](/.image/swing/菜单管理1.png) | ![菜单管理2](/.image/swing/菜单管理2.png) | ![菜单管理3](/.image/swing/菜单管理3.png) | +| 部门管理 | ![部门管理](/.image/swing/部门管理1.png) | ![部门管理](/.image/swing/部门管理2.png) | ![部门管理](/.image/swing/部门管理3.png) | +| 岗位管理 | ![岗位管理](/.image/swing/岗位管理1.png) | ![岗位管理](/.image/swing/岗位管理2.png) | ![岗位管理](/.image/swing/岗位管理3.png) | +| 字典管理 | ![字典管理](/.image/swing/字典管理1.png) | ![字典管理](/.image/swing/字典管理2.png) | ![字典管理](/.image/swing/字典管理3.png) | +| 字典数据 | ![字典数据](/.image/swing/字典数据1.png) | ![字典数据](/.image/swing/字典数据2.png) | ![字典数据](/.image/swing/字典数据3.png) | +| 通知公告 | ![通知公告](/.image/swing/通知公告1.png) | ![字典数据](/.image/swing/通知公告2.png) | ![字典数据](/.image/swing/通知公告3.png) | +| 消息模板 | ![消息模板](/.image/swing/消息模板1.png) | ![消息模板](/.image/swing/消息模板2.png) | ![消息模板](/.image/swing/消息模板3.png) | +| 消息记录 | ![消息记录](/.image/swing/消息记录1.png) | ![消息记录](/.image/swing/消息记录2.png) | ![消息记录](/.image/swing/消息记录3.png) | +| 我的消息 | ![我的消息](/.image/swing/我的消息1.png) | ![我的消息](/.image/swing/我的消息2.png) | ![我的消息](/.image/swing/我的消息3.png) | +| 操作日志 | ![操作日志](/.image/swing/操作日志1.png) | ![操作日志](/.image/swing/操作日志2.png) | ![操作日志](/.image/swing/操作日志3.png) | +| 登录日志 | ![登录日志](/.image/swing/登录日志1.png) | ![登录日志](/.image/swing/登录日志2.png) | ![登录日志](/.image/swing/登录日志3.png) | +| 文件配置 | ![文件配置](/.image/swing/文件配置1.png) | ![文件配置](/.image/swing/文件配置2.png) | ![文件配置](/.image/swing/文件配置3.png) | +| 文件列表 | ![文件列表](/.image/swing/文件列表1.png) | ![文件列表](/.image/swing/文件列表2.png) | ![文件列表](/.image/swing/文件列表3.png) | +| 定时任务 | ![定时任务](/.image/swing/定时任务1.png) | ![定时任务](/.image/swing/定时任务2.png) | ![定时任务](/.image/swing/定时任务3.png) | +| 执行日志 | ![执行日志](/.image/swing/执行日志1.png) | ![执行日志](/.image/swing/执行日志2.png) | ![执行日志](/.image/swing/执行日志3.png) | +| API-访问日志 | ![API-访问日志](/.image/swing/API-访问日志1.png) | ![API-访问日志](/.image/swing/API-访问日志2.png) | ![API-访问日志](/.image/swing/API-访问日志3.png) | +| API-错误日志 | ![API-错误日志](/.image/swing/API-错误日志1.png) | ![API-错误日志](/.image/swing/API-错误日志2.png) | ![API-错误日志](/.image/swing/API-错误日志3.png) | +| 配置管理 | ![配置管理](/.image/swing/配置管理1.png) | ![配置管理](/.image/swing/配置管理2.png) | ![配置管理](/.image/swing/配置管理3.png) | diff --git a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/logger/OperateLogDO.java b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/logger/OperateLogDO.java index dcb4b4a..a9423e6 100644 --- a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/logger/OperateLogDO.java +++ b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/logger/OperateLogDO.java @@ -1,10 +1,10 @@ package com.lw.dillon.admin.module.system.dal.dataobject.logger; -import com.lw.dillon.admin.framework.common.enums.UserTypeEnum; -import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.lw.dillon.admin.framework.common.enums.UserTypeEnum; +import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; /** diff --git a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notice/NoticeDO.java b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notice/NoticeDO.java index cd0a082..3a99b70 100644 --- a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notice/NoticeDO.java +++ b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notice/NoticeDO.java @@ -1,10 +1,10 @@ package com.lw.dillon.admin.module.system.dal.dataobject.notice; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableName; import com.lw.dillon.admin.framework.common.enums.CommonStatusEnum; import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import com.lw.dillon.admin.module.system.enums.notice.NoticeTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyMessageDO.java b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyMessageDO.java index 5c116bd..9f30c6b 100644 --- a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyMessageDO.java +++ b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyMessageDO.java @@ -1,17 +1,15 @@ package com.lw.dillon.admin.module.system.dal.dataobject.notify; -import com.lw.dillon.admin.framework.common.enums.UserTypeEnum; -import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; -import com.lw.dillon.admin.module.system.dal.dataobject.mail.MailTemplateDO; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.lw.dillon.admin.framework.common.enums.UserTypeEnum; +import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import lombok.*; import java.time.LocalDateTime; -import java.util.Date; import java.util.Map; /** diff --git a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyTemplateDO.java b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyTemplateDO.java index 620d699..8e94300 100644 --- a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyTemplateDO.java +++ b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/notify/NotifyTemplateDO.java @@ -1,12 +1,12 @@ package com.lw.dillon.admin.module.system.dal.dataobject.notify; -import com.lw.dillon.admin.framework.common.enums.CommonStatusEnum; -import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.lw.dillon.admin.framework.common.enums.CommonStatusEnum; +import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import lombok.*; import java.util.List; diff --git a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java index 5264f0c..c4e1db5 100644 --- a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java +++ b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java @@ -1,11 +1,11 @@ package com.lw.dillon.admin.module.system.dal.dataobject.oauth2; -import com.lw.dillon.admin.framework.common.enums.UserTypeEnum; -import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.lw.dillon.admin.framework.common.enums.UserTypeEnum; +import com.lw.dillon.admin.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/config/ConfigFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/config/ConfigFeign.java new file mode 100644 index 0000000..545ddbf --- /dev/null +++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/config/ConfigFeign.java @@ -0,0 +1,41 @@ +package com.lw.ui.request.api.config; + +import com.lw.dillon.admin.framework.common.pojo.CommonResult; +import com.lw.dillon.admin.framework.common.pojo.PageResult; +import com.lw.dillon.admin.module.infra.controller.admin.config.vo.ConfigRespVO; +import com.lw.dillon.admin.module.infra.controller.admin.config.vo.ConfigSaveReqVO; +import com.lw.ui.request.api.BaseFeignApi; +import feign.Param; +import feign.QueryMap; +import feign.RequestLine; + +import java.util.Map; + +public interface ConfigFeign extends BaseFeignApi { + + //"创建参数配置") + @RequestLine("POST /admin-api/infra/config/create") + public CommonResult createConfig(ConfigSaveReqVO createReqVO); + + //"修改参数配置") + @RequestLine("PUT /admin-api/infra/config/update") + public CommonResult updateConfig(ConfigSaveReqVO updateReqVO); + + //"删除参数配置") + @RequestLine("DELETE /admin-api/infra/config/delete?id={id}") + public CommonResult deleteConfig(@Param("id") Long id); + + //"获得参数配置") + @RequestLine("GET /admin-api/infra/config/get?id={id}") + public CommonResult getConfig(@Param("id") Long id); + + //"根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端") + @RequestLine("GET /admin-api/infra/config/get-value-by-key?key={key}") + public CommonResult getConfigKey(@Param("key") String key); + + //"获取参数配置分页") + @RequestLine("GET /admin-api/infra/config/page") + public CommonResult> getConfigPage(@QueryMap Map pageReqVO); + + +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiAccessLogView.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiAccessLogView.java new file mode 100644 index 0000000..635c3d6 --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiAccessLogView.java @@ -0,0 +1,482 @@ +package com.lw.fx.view.infra.apilog; + +import cn.hutool.core.date.DateUtil; +import com.dlsc.gemsfx.DialogPane; +import com.lw.dillon.admin.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogRespVO; +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.store.AppStore; +import com.lw.fx.view.control.PagingControl; +import com.lw.fx.view.control.WFXGenericDialog; +import com.lw.ui.utils.DictTypeEnum; +import de.saxsys.mvvmfx.FxmlView; +import de.saxsys.mvvmfx.InjectViewModel; +import javafx.collections.FXCollections; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; +import javafx.util.Callback; +import org.kordamp.ikonli.feather.Feather; +import org.kordamp.ikonli.javafx.FontIcon; + +import java.net.URL; +import java.time.LocalDateTime; +import java.util.Map; +import java.util.ResourceBundle; + +import static atlantafx.base.theme.Styles.*; +import static com.lw.ui.utils.DictTypeEnum.INFRA_OPERATE_TYPE; +import static com.lw.ui.utils.DictTypeEnum.USER_TYPE; + +public class ApiAccessLogView implements FxmlView, Initializable { + + @InjectViewModel + private ApiAccessLogViewModel viewModel; + @FXML + private TableColumn applicationNameCol; + + @FXML + private TextField applicationNameField; + + @FXML + private TableColumn beginTimeCol; + + @FXML + private VBox contentPane; + + @FXML + private TableColumn durationCol; + + @FXML + private TextField durationField; + + @FXML + private DatePicker endDatePicker; + + @FXML + private TableColumn idCol; + + @FXML + private TableColumn operateModuleCol; + + @FXML + private TableColumn operateNameCol; + + @FXML + private TableColumn operateTypeCol; + + @FXML + private TableColumn optCol; + + @FXML + private TableColumn requestMethodCol; + + @FXML + private TableColumn requestUrlCol; + + @FXML + private Button resetBut; + + @FXML + private TextField resultCodeField; + + @FXML + private StackPane rootPane; + + @FXML + private Button searchBut; + + @FXML + private DatePicker startDatePicker; + + @FXML + private TableColumn statusCol; + + @FXML + private TableView tableView; + + @FXML + private TableColumn userIdCol; + + @FXML + private TextField userIdField; + + @FXML + private TableColumn userTypeCol; + + @FXML + private ComboBox userTypeComboBox; + + private PagingControl pagingControl; + + private DialogPane dialogPane; + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + + dialogPane = new DialogPane(); + rootPane.getChildren().add(dialogPane); + pagingControl = new PagingControl(); + contentPane.getChildren().add(pagingControl); + + pagingControl.totalProperty().bind(viewModel.totalProperty()); + viewModel.pageNumProperty().bind(pagingControl.pageNumProperty()); + viewModel.pageSizeProperty().bind(pagingControl.pageSizeProperty()); + pagingControl.pageNumProperty().addListener((observable, oldValue, newValue) -> { + viewModel.loadTableData(); + }); + + pagingControl.pageSizeProperty().addListener((observable, oldValue, newValue) -> { + viewModel.loadTableData(); + }); + idCol.setCellValueFactory(new PropertyValueFactory<>("id")); + idCol.setStyle("-fx-alignment: CENTER"); + + userIdCol.setCellValueFactory(new PropertyValueFactory<>("userId")); + userIdCol.setStyle("-fx-alignment: CENTER"); + + userTypeCol.setCellValueFactory(new PropertyValueFactory<>("userType")); + userTypeCol.setStyle("-fx-alignment: CENTER"); + userTypeCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(Integer item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(USER_TYPE).get(item + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + + HBox box = new HBox(state); + box.setPadding(new Insets(7, 7, 7, 7)); + box.setAlignment(Pos.CENTER); + setGraphic(box); + + + } + + } + }; + } + }); + operateTypeCol.setCellValueFactory(new PropertyValueFactory<>("operateType")); + operateTypeCol.setStyle("-fx-alignment: CENTER"); + operateTypeCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(Integer item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(INFRA_OPERATE_TYPE).get(item + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + + HBox box = new HBox(state); + box.setPadding(new Insets(7, 7, 7, 7)); + box.setAlignment(Pos.CENTER); + setGraphic(box); + + + } + + } + }; + } + }); + + applicationNameCol.setCellValueFactory(new PropertyValueFactory<>("applicationName")); + applicationNameCol.setStyle("-fx-alignment: CENTER"); + + requestMethodCol.setCellValueFactory(new PropertyValueFactory<>("requestMethod")); + requestMethodCol.setStyle("-fx-alignment: CENTER"); + + requestUrlCol.setCellValueFactory(new PropertyValueFactory<>("requestUrl")); + requestUrlCol.setStyle("-fx-alignment: CENTER"); + + durationCol.setCellValueFactory(new PropertyValueFactory<>("duration")); + durationCol.setStyle("-fx-alignment: CENTER"); + + operateModuleCol.setCellValueFactory(new PropertyValueFactory<>("operateModule")); + operateModuleCol.setStyle("-fx-alignment: CENTER"); + operateNameCol.setCellValueFactory(new PropertyValueFactory<>("operateName")); + operateNameCol.setStyle("-fx-alignment: CENTER"); + + statusCol.setCellValueFactory(new PropertyValueFactory<>("resultCode")); + statusCol.setStyle("-fx-alignment: CENTER"); + statusCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(Integer item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + String text = ""; + String colorType = ""; + if (item == 0) { + text = "成功"; + colorType = "success"; + } else { + text = "失败(" + getTableRow().getItem().getResultMsg() + ")"; + colorType = "danger"; + } + Button state = new Button(text); + switch (colorType) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + + HBox box = new HBox(state); + box.setPadding(new Insets(7, 7, 7, 7)); + box.setAlignment(Pos.CENTER); + setGraphic(box); + + } + + } + }; + } + }); + + beginTimeCol.setCellValueFactory(new PropertyValueFactory<>("beginTime")); + beginTimeCol.setStyle("-fx-alignment: CENTER"); + beginTimeCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(LocalDateTime item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + } else { + + + if (item != null) { + this.setText(DateUtil.format(item, "yyyy-MM-dd HH:mm:ss")); + } + } + + } + }; + } + }); + + optCol.setCellValueFactory(new PropertyValueFactory<>("id")); + optCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + + TableCell cell = new TableCell() { + @Override + protected void updateItem(Long item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + Button editBut = new Button("详情"); + editBut.setOnAction(event -> showFormView(getTableRow().getItem())); + editBut.setGraphic(FontIcon.of(Feather.EYE)); + editBut.getStyleClass().addAll(FLAT, ACCENT); + + HBox box = new HBox(editBut); + box.setAlignment(Pos.CENTER); +// box.setSpacing(7); + setGraphic(box); + } + } + }; + return cell; + } + }); + tableView.itemsProperty().bind(viewModel.tableItemsProperty()); + + userIdField.textProperty().bindBidirectional(viewModel.userIdProperty()); + applicationNameField.textProperty().bindBidirectional(viewModel.applicationNameProperty()); + durationField.textProperty().bindBidirectional(viewModel.durationProperty()); + resultCodeField.textProperty().bindBidirectional(viewModel.resultCodeProperty()); + + searchBut.setOnAction(actionEvent -> viewModel.loadTableData()); + resetBut.setOnAction(actionEvent -> { + userIdField.setText(null); + applicationNameField.setText(null); + durationField.setText(null); + resultCodeField.setText(null); + startDatePicker.setValue(null); + endDatePicker.setValue(null); + userTypeComboBox.getSelectionModel().select(null); + viewModel.loadTableData(); + }); + startDatePicker.valueProperty().bindBidirectional(viewModel.beginDateProperty()); + endDatePicker.valueProperty().bindBidirectional(viewModel.endDateProperty()); + userTypeComboBox.setItems(FXCollections.observableArrayList(AppStore.getDictDataList(USER_TYPE))); + userTypeComboBox.valueProperty().bindBidirectional(viewModel.selUserTypeProperty()); + } + + + /** + * 显示编辑对话框 + */ + private void showFormView(ApiAccessLogRespVO respVO) { + WFXGenericDialog dialog = new WFXGenericDialog(); + + + dialog.addActions( + + Map.entry(new Button("确定"), event -> { + dialog.close(); + }) + ); + + VBox vBox = new VBox(10, + createTextField("日志编号", respVO.getId()+"") + , createTextField("链路追踪", respVO.getTraceId() ) + , createTextField("应用名", respVO.getApplicationName()) + , createDictBut("用户信息", respVO.getUserType(),USER_TYPE) + , createTextField("用户 IP", respVO.getUserIp()) + , createTextField("用户 UA", respVO.getUserAgent()) + , createTextField("请求信息", respVO.getRequestMethod()+" "+respVO.getRequestUrl()) + , createTextField("请求参数", respVO.getRequestParams()) + , createTextField("请求结果", respVO.getResponseBody()) + , createTextField("请求时间", DateUtil.format(respVO.getBeginTime(), "yyyy-MM-dd HH:mm:ss") + " ~ " + DateUtil.format(respVO.getEndTime(), "yyyy-MM-dd HH:mm:ss")) + , createTextField("请求耗时", respVO.getDuration() + "毫秒") + , createTextField("操作结果", respVO.getResultCode()==0?"正常":("失败 | "+respVO.getResultCode()+" | "+respVO.getResultMsg())) + , createTextField("操作模块", respVO.getOperateModule()) + , createTextField("操作名", respVO.getOperateName()) + , createDictBut("操作类型", respVO.getOperateType(),INFRA_OPERATE_TYPE) + + ); + + vBox.setPrefWidth(500); + + dialog.setHeaderIcon(FontIcon.of(Feather.INFO)); + dialog.setHeaderText("详情"); + dialog.setContent(vBox); + dialog.show(rootPane.getScene()); + + } + + + private HBox createTextField(String text, String value) { + Label label = new Label(text); + label.setAlignment(Pos.CENTER_RIGHT); + label.setPrefWidth(100); + TextField textField = new TextField(value); + textField.setEditable(false); + HBox.setHgrow(textField, Priority.ALWAYS); + HBox hBox = new HBox(7, label, textField); + hBox.setAlignment(Pos.CENTER_LEFT); + return hBox; + } + + private HBox createDictBut(String text, Object value, DictTypeEnum dictTypeEnum) { + Label label = new Label(text); + label.setAlignment(Pos.CENTER_RIGHT); + label.setPrefWidth(100); + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(dictTypeEnum).get(value + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + HBox hBox = new HBox(7, label, state); + hBox.setAlignment(Pos.CENTER_LEFT); + return hBox; + } + + +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiAccessLogViewModel.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiAccessLogViewModel.java new file mode 100644 index 0000000..7709a51 --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiAccessLogViewModel.java @@ -0,0 +1,175 @@ +package com.lw.fx.view.infra.apilog; + +import cn.hutool.core.util.ObjectUtil; +import com.lw.dillon.admin.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogRespVO; +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.request.Request; +import com.lw.ui.request.api.apilog.ApiAccessLogFeign; +import de.saxsys.mvvmfx.SceneLifecycle; +import de.saxsys.mvvmfx.ViewModel; +import io.datafx.core.concurrent.ProcessChain; +import javafx.beans.property.*; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class ApiAccessLogViewModel implements ViewModel, SceneLifecycle { + + private SimpleIntegerProperty total = new SimpleIntegerProperty(0); + private IntegerProperty pageNum = new SimpleIntegerProperty(0); + private IntegerProperty pageSize = new SimpleIntegerProperty(10); + + private ObjectProperty> tableItems = new SimpleObjectProperty<>(); + + + private ObjectProperty beginDate = new SimpleObjectProperty<>(); + private ObjectProperty endDate = new SimpleObjectProperty<>(); + private StringProperty userId = new SimpleStringProperty(); + private StringProperty applicationName = new SimpleStringProperty(); + private StringProperty duration = new SimpleStringProperty(); + private StringProperty resultCode = new SimpleStringProperty(); + + private ObjectProperty selUserType = new SimpleObjectProperty<>(); + + + public ApiAccessLogViewModel() { + loadTableData(); + } + + + public void loadTableData() { + + Map queryMap = new HashMap<>(); + queryMap.put("pageNo", pageNum.get() + 1); + queryMap.put("pageSize", pageSize.get()); + + queryMap.put("userId", userId.get()); + queryMap.put("userType", Optional.ofNullable(selUserType.get()).map(DictDataSimpleRespVO::getValue).orElse(null)); + queryMap.put("applicationName", applicationName.get()); + queryMap.put("duration", duration.get()); + queryMap.put("resultCode", resultCode.get()); + + if (ObjectUtil.isAllNotEmpty(getBeginDate(), getEndDate())) { + String sd = getBeginDate().atTime(0, 0, 0).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + String ed = getEndDate().atTime(23, 59, 59).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + queryMap.put("beginTime", new String[]{sd, ed}); + } + + ProcessChain.create() + + .addSupplierInExecutor(() -> Request.connector(ApiAccessLogFeign.class).getApiAccessLogPage(queryMap)) + .addConsumerInPlatformThread(listCommonResult -> { + if (listCommonResult.isSuccess()) { + ObservableList respVOS = FXCollections.observableArrayList(); + respVOS.addAll(listCommonResult.getData().getList()); + tableItems.set(respVOS); + totalProperty().set(listCommonResult.getData().getTotal().intValue()); + } + }) + .run(); + + + } + + + public ObjectProperty> tableItemsProperty() { + return tableItems; + } + + + public LocalDate getBeginDate() { + return beginDate.get(); + } + + public ObjectProperty beginDateProperty() { + return beginDate; + } + + public LocalDate getEndDate() { + return endDate.get(); + } + + public ObjectProperty endDateProperty() { + return endDate; + } + + + public int getTotal() { + return total.get(); + } + + public SimpleIntegerProperty totalProperty() { + return total; + } + + public int getPageNum() { + return pageNum.get(); + } + + public IntegerProperty pageNumProperty() { + return pageNum; + } + + public int getPageSize() { + return pageSize.get(); + } + + public IntegerProperty pageSizeProperty() { + return pageSize; + } + + public String getUserId() { + return userId.get(); + } + + public StringProperty userIdProperty() { + return userId; + } + + public String getApplicationName() { + return applicationName.get(); + } + + public StringProperty applicationNameProperty() { + return applicationName; + } + + public DictDataSimpleRespVO getSelUserType() { + return selUserType.get(); + } + + public ObjectProperty selUserTypeProperty() { + return selUserType; + } + + public String getDuration() { + return duration.get(); + } + + public StringProperty durationProperty() { + return duration; + } + + public String getResultCode() { + return resultCode.get(); + } + + public StringProperty resultCodeProperty() { + return resultCode; + } + + @Override + public void onViewAdded() { + + } + + @Override + public void onViewRemoved() { + + } +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiErrorLogView.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiErrorLogView.java new file mode 100644 index 0000000..85445cf --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiErrorLogView.java @@ -0,0 +1,453 @@ +package com.lw.fx.view.infra.apilog; + +import cn.hutool.core.date.DateUtil; +import com.dlsc.gemsfx.DialogPane; +import com.lw.dillon.admin.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogRespVO; +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.request.Request; +import com.lw.fx.store.AppStore; +import com.lw.fx.util.MessageType; +import com.lw.fx.view.control.PagingControl; +import com.lw.fx.view.control.WFXGenericDialog; +import com.lw.ui.request.api.apilog.ApiErrorLogFeign; +import com.lw.ui.utils.DictTypeEnum; +import de.saxsys.mvvmfx.FxmlView; +import de.saxsys.mvvmfx.InjectViewModel; +import de.saxsys.mvvmfx.MvvmFX; +import io.datafx.core.concurrent.ProcessChain; +import javafx.collections.FXCollections; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; +import javafx.util.Callback; +import org.kordamp.ikonli.feather.Feather; +import org.kordamp.ikonli.javafx.FontIcon; + +import java.net.URL; +import java.time.LocalDateTime; +import java.util.Map; +import java.util.ResourceBundle; + +import static atlantafx.base.theme.Styles.*; +import static com.lw.ui.utils.DictTypeEnum.INFRA_API_ERROR_LOG_PROCESS_STATUS; +import static com.lw.ui.utils.DictTypeEnum.USER_TYPE; + +public class ApiErrorLogView implements FxmlView, Initializable { + + @InjectViewModel + private ApiErrorLogViewModel viewModel; + @FXML + private TableColumn applicationNameCol; + + @FXML + private TextField applicationNameField; + + @FXML + private TableColumn exceptionTimeCol; + + @FXML + private VBox contentPane; + + @FXML + private TableColumn exceptionNameCol; + + + @FXML + private DatePicker endDatePicker; + + @FXML + private TableColumn idCol; + + + @FXML + private TableColumn optCol; + + @FXML + private TableColumn requestMethodCol; + + @FXML + private TableColumn requestUrlCol; + + @FXML + private Button resetBut; + + @FXML + private ComboBox processStatusComBox; + + @FXML + private StackPane rootPane; + + @FXML + private Button searchBut; + + @FXML + private DatePicker startDatePicker; + + @FXML + private TableColumn processStatusCol; + + @FXML + private TableView tableView; + + @FXML + private TableColumn userIdCol; + + @FXML + private TextField userIdField; + + @FXML + private TableColumn userTypeCol; + + @FXML + private ComboBox userTypeComboBox; + + private PagingControl pagingControl; + + private DialogPane dialogPane; + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + + dialogPane = new DialogPane(); + rootPane.getChildren().add(dialogPane); + pagingControl = new PagingControl(); + contentPane.getChildren().add(pagingControl); + + pagingControl.totalProperty().bind(viewModel.totalProperty()); + viewModel.pageNumProperty().bind(pagingControl.pageNumProperty()); + viewModel.pageSizeProperty().bind(pagingControl.pageSizeProperty()); + pagingControl.pageNumProperty().addListener((observable, oldValue, newValue) -> { + viewModel.loadTableData(); + }); + + pagingControl.pageSizeProperty().addListener((observable, oldValue, newValue) -> { + viewModel.loadTableData(); + }); + idCol.setCellValueFactory(new PropertyValueFactory<>("id")); + idCol.setStyle("-fx-alignment: CENTER"); + + userIdCol.setCellValueFactory(new PropertyValueFactory<>("userId")); + userIdCol.setStyle("-fx-alignment: CENTER"); + + userTypeCol.setCellValueFactory(new PropertyValueFactory<>("userType")); + userTypeCol.setStyle("-fx-alignment: CENTER"); + userTypeCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(Integer item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(USER_TYPE).get(item + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + + HBox box = new HBox(state); + box.setPadding(new Insets(7, 7, 7, 7)); + box.setAlignment(Pos.CENTER); + setGraphic(box); + + + } + + } + }; + } + }); + processStatusCol.setCellValueFactory(new PropertyValueFactory<>("processStatus")); + processStatusCol.setStyle("-fx-alignment: CENTER"); + processStatusCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(Integer item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(INFRA_API_ERROR_LOG_PROCESS_STATUS).get(item + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + + HBox box = new HBox(state); + box.setPadding(new Insets(7, 7, 7, 7)); + box.setAlignment(Pos.CENTER); + setGraphic(box); + + + } + + } + }; + } + }); + + applicationNameCol.setCellValueFactory(new PropertyValueFactory<>("applicationName")); + applicationNameCol.setStyle("-fx-alignment: CENTER"); + + requestMethodCol.setCellValueFactory(new PropertyValueFactory<>("requestMethod")); + requestMethodCol.setStyle("-fx-alignment: CENTER"); + + requestUrlCol.setCellValueFactory(new PropertyValueFactory<>("requestUrl")); + requestUrlCol.setStyle("-fx-alignment: CENTER"); + + exceptionNameCol.setCellValueFactory(new PropertyValueFactory<>("exceptionName")); + exceptionNameCol.setStyle("-fx-alignment: CENTER"); + + + exceptionTimeCol.setCellValueFactory(new PropertyValueFactory<>("exceptionTime")); + exceptionTimeCol.setStyle("-fx-alignment: CENTER"); + exceptionTimeCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(LocalDateTime item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + } else { + + + if (item != null) { + this.setText(DateUtil.format(item, "yyyy-MM-dd HH:mm:ss")); + } + } + + } + }; + } + }); + + optCol.setCellValueFactory(new PropertyValueFactory<>("id")); + optCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + + TableCell cell = new TableCell() { + @Override + protected void updateItem(Integer item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + Button editBut = new Button("详情"); + editBut.setOnAction(event -> showFormView(getTableRow().getItem())); + editBut.setGraphic(FontIcon.of(Feather.EYE)); + editBut.getStyleClass().addAll(FLAT, ACCENT); + + Button processedBut = new Button("已处理"); + processedBut.setOnAction(event -> showDelDialog(getTableRow().getItem().getId(),1)); + processedBut.getStyleClass().addAll(FLAT, ACCENT); + + Button ignoredBut = new Button("已忽略"); + ignoredBut.setOnAction(event -> showDelDialog(getTableRow().getItem().getId(),2)); + ignoredBut.getStyleClass().addAll(FLAT, ACCENT); + + HBox box = new HBox(editBut, processedBut, ignoredBut); + box.setAlignment(Pos.CENTER); +// box.setSpacing(7); + setGraphic(box); + } + } + }; + return cell; + } + }); + tableView.itemsProperty().bind(viewModel.tableItemsProperty()); + + userIdField.textProperty().bindBidirectional(viewModel.userIdProperty()); + applicationNameField.textProperty().bindBidirectional(viewModel.applicationNameProperty()); + + searchBut.setOnAction(actionEvent -> viewModel.loadTableData()); + resetBut.setOnAction(actionEvent -> { + userIdField.setText(null); + applicationNameField.setText(null); + startDatePicker.setValue(null); + endDatePicker.setValue(null); + userTypeComboBox.getSelectionModel().select(null); + processStatusComBox.getSelectionModel().select(null); + viewModel.loadTableData(); + }); + startDatePicker.valueProperty().bindBidirectional(viewModel.beginDateProperty()); + endDatePicker.valueProperty().bindBidirectional(viewModel.endDateProperty()); + userTypeComboBox.setItems(FXCollections.observableArrayList(AppStore.getDictDataList(USER_TYPE))); + userTypeComboBox.valueProperty().bindBidirectional(viewModel.selUserTypeProperty()); + + processStatusComBox.setItems(FXCollections.observableArrayList(AppStore.getDictDataList(INFRA_API_ERROR_LOG_PROCESS_STATUS))); + processStatusComBox.valueProperty().bindBidirectional(viewModel.processStatusProperty()); + } + + + /** + * 显示编辑对话框 + */ + private void showFormView(ApiErrorLogRespVO respVO) { + WFXGenericDialog dialog = new WFXGenericDialog(); + + + dialog.addActions( + + Map.entry(new Button("确定"), event -> { + dialog.close(); + }) + ); + + VBox vBox = new VBox(10, + createTextField("日志编号", respVO.getId() + "") + , createTextField("链路追踪", respVO.getTraceId()) + , createTextField("应用名", respVO.getApplicationName()) + , createDictBut("用户信息", respVO.getUserType(), USER_TYPE) + , createTextField("用户 IP", respVO.getUserIp()) + , createTextField("用户 UA", respVO.getUserAgent()) + , createTextField("请求信息", respVO.getRequestMethod() + " " + respVO.getRequestUrl()) + , createTextField("请求参数", respVO.getRequestParams()) + , createTextField("异常时间", DateUtil.format(respVO.getExceptionTime(), "yyyy-MM-dd HH:mm:ss")) + , createTextField("异常名", respVO.getExceptionName()) + , createTextField("异常堆栈", respVO.getExceptionStackTrace()) + , createDictBut("处理状态", respVO.getProcessStatus(), INFRA_API_ERROR_LOG_PROCESS_STATUS) + , createTextField("处理人", respVO.getProcessUserId() + "") + , createTextField("处理时间", DateUtil.format(respVO.getProcessTime(), "yyyy-MM-dd HH:mm:ss")) + + ); + + vBox.setPrefWidth(500); + + dialog.setHeaderIcon(FontIcon.of(Feather.INFO)); + dialog.setHeaderText("详情"); + dialog.setContent(vBox); + dialog.show(rootPane.getScene()); + + } + + + private HBox createTextField(String text, String value) { + Label label = new Label(text); + label.setAlignment(Pos.CENTER_RIGHT); + label.setPrefWidth(100); + TextField textField = new TextField(value); + textField.setEditable(false); + HBox.setHgrow(textField, Priority.ALWAYS); + HBox hBox = new HBox(7, label, textField); + hBox.setAlignment(Pos.CENTER_LEFT); + return hBox; + } + + private HBox createDictBut(String text, Object value, DictTypeEnum dictTypeEnum) { + Label label = new Label(text); + label.setAlignment(Pos.CENTER_RIGHT); + label.setPrefWidth(100); + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(dictTypeEnum).get(value + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + HBox hBox = new HBox(7, label, state); + hBox.setAlignment(Pos.CENTER_LEFT); + return hBox; + } + + + private void showDelDialog(Integer id, Integer processStatus) { + + String type = processStatus == 1 ? "已处理" : "已忽略"; + WFXGenericDialog dialog = new WFXGenericDialog(); + dialog.setHeaderIcon(FontIcon.of(Feather.INFO)); + dialog.setHeaderText("系统提示"); + dialog.addActions( + Map.entry(new Button("取消"), event -> dialog.close()), + Map.entry(new Button("确定"), event -> { + ProcessChain.create() + .addSupplierInExecutor(() -> { + return Request.connector(ApiErrorLogFeign.class).updateApiErrorLogProcess(id.longValue(), processStatus); + }) + .addConsumerInPlatformThread(r -> { + if (r.isSuccess()) { + MvvmFX.getNotificationCenter().publish("message", "删除成功", MessageType.SUCCESS); + + dialog.close(); + viewModel.loadTableData(); + } + }).onException(e -> e.printStackTrace()) + .run(); + }) + ); + + dialog.setContent(new Label("确认标记为" + type + "?")); + dialog.show(rootPane.getScene()); + } + +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiErrorLogViewModel.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiErrorLogViewModel.java new file mode 100644 index 0000000..3083b30 --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/apilog/ApiErrorLogViewModel.java @@ -0,0 +1,165 @@ +package com.lw.fx.view.infra.apilog; + +import cn.hutool.core.util.ObjectUtil; +import com.lw.dillon.admin.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogRespVO; +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.request.Request; +import com.lw.ui.request.api.apilog.ApiErrorLogFeign; +import de.saxsys.mvvmfx.SceneLifecycle; +import de.saxsys.mvvmfx.ViewModel; +import io.datafx.core.concurrent.ProcessChain; +import javafx.beans.property.*; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class ApiErrorLogViewModel implements ViewModel, SceneLifecycle { + + private SimpleIntegerProperty total = new SimpleIntegerProperty(0); + private IntegerProperty pageNum = new SimpleIntegerProperty(0); + private IntegerProperty pageSize = new SimpleIntegerProperty(10); + + private ObjectProperty> tableItems = new SimpleObjectProperty<>(); + + + private ObjectProperty beginDate = new SimpleObjectProperty<>(); + private ObjectProperty endDate = new SimpleObjectProperty<>(); + private StringProperty userId = new SimpleStringProperty(); + private StringProperty applicationName = new SimpleStringProperty(); + + private ObjectProperty selUserType = new SimpleObjectProperty<>(); + private ObjectProperty processStatus = new SimpleObjectProperty<>(); + + + public ApiErrorLogViewModel() { + loadTableData(); + } + + + public void loadTableData() { + + Map queryMap = new HashMap<>(); + queryMap.put("pageNo", pageNum.get() + 1); + queryMap.put("pageSize", pageSize.get()); + + queryMap.put("userId", userId.get()); + queryMap.put("userType", Optional.ofNullable(selUserType.get()).map(DictDataSimpleRespVO::getValue).orElse(null)); + queryMap.put("applicationName", applicationName.get()); + queryMap.put("processStatus", Optional.ofNullable(processStatus.get()).map(DictDataSimpleRespVO::getValue).orElse(null)); + + if (ObjectUtil.isAllNotEmpty(getBeginDate(), getEndDate())) { + String sd = getBeginDate().atTime(0, 0, 0).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + String ed = getEndDate().atTime(23, 59, 59).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + queryMap.put("exceptionTime", new String[]{sd, ed}); + } + + ProcessChain.create() + + .addSupplierInExecutor(() -> Request.connector(ApiErrorLogFeign.class).getApiErrorLogPage(queryMap)) + .addConsumerInPlatformThread(listCommonResult -> { + if (listCommonResult.isSuccess()) { + ObservableList respVOS = FXCollections.observableArrayList(); + respVOS.addAll(listCommonResult.getData().getList()); + tableItems.set(respVOS); + totalProperty().set(listCommonResult.getData().getTotal().intValue()); + } + }) + .run(); + + + } + + + public ObjectProperty> tableItemsProperty() { + return tableItems; + } + + + public LocalDate getBeginDate() { + return beginDate.get(); + } + + public ObjectProperty beginDateProperty() { + return beginDate; + } + + public LocalDate getEndDate() { + return endDate.get(); + } + + public ObjectProperty endDateProperty() { + return endDate; + } + + + public int getTotal() { + return total.get(); + } + + public SimpleIntegerProperty totalProperty() { + return total; + } + + public int getPageNum() { + return pageNum.get(); + } + + public IntegerProperty pageNumProperty() { + return pageNum; + } + + public int getPageSize() { + return pageSize.get(); + } + + public IntegerProperty pageSizeProperty() { + return pageSize; + } + + public String getUserId() { + return userId.get(); + } + + public StringProperty userIdProperty() { + return userId; + } + + public String getApplicationName() { + return applicationName.get(); + } + + public StringProperty applicationNameProperty() { + return applicationName; + } + + public DictDataSimpleRespVO getSelUserType() { + return selUserType.get(); + } + + public ObjectProperty selUserTypeProperty() { + return selUserType; + } + + public DictDataSimpleRespVO getProcessStatus() { + return processStatus.get(); + } + + public ObjectProperty processStatusProperty() { + return processStatus; + } + + @Override + public void onViewAdded() { + + } + + @Override + public void onViewRemoved() { + + } +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigFormView.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigFormView.java new file mode 100644 index 0000000..d9be2b3 --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigFormView.java @@ -0,0 +1,53 @@ +package com.lw.fx.view.infra.config; + +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.store.AppStore; +import de.saxsys.mvvmfx.FxmlView; +import de.saxsys.mvvmfx.InjectViewModel; +import javafx.collections.FXCollections; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.ComboBox; +import javafx.scene.control.TextArea; +import javafx.scene.control.TextField; + +import java.net.URL; +import java.util.ResourceBundle; + +import static com.lw.ui.utils.DictTypeEnum.INFRA_BOOLEAN_STRING; + +public class ConfigFormView implements FxmlView, Initializable { + @InjectViewModel + private ConfigFormViewModel viewModel; + @FXML + private TextField categoryField; + + @FXML + private TextField keyField; + + @FXML + private TextField nameField; + + @FXML + private TextArea remarksTextArea; + + @FXML + private TextField valueField; + + @FXML + private ComboBox visibleComboBox; + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + + nameField.textProperty().bindBidirectional(viewModel.nameProperty()); + categoryField.textProperty().bindBidirectional(viewModel.categoryProperty()); + keyField.textProperty().bindBidirectional(viewModel.keyProperty()); + valueField.textProperty().bindBidirectional(viewModel.valueProperty()); + remarksTextArea.textProperty().bindBidirectional(viewModel.remartProperty()); + + visibleComboBox.setItems(FXCollections.observableArrayList(AppStore.getDictDataList(INFRA_BOOLEAN_STRING))); + visibleComboBox.valueProperty().bindBidirectional(viewModel.visbleSelProperty()); + + } +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigFormViewModel.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigFormViewModel.java new file mode 100644 index 0000000..0a49268 --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigFormViewModel.java @@ -0,0 +1,114 @@ +package com.lw.fx.view.infra.config; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.convert.Convert; +import com.lw.dillon.admin.framework.common.pojo.CommonResult; +import com.lw.dillon.admin.module.infra.controller.admin.config.vo.ConfigSaveReqVO; +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.request.Request; +import com.lw.fx.store.AppStore; +import com.lw.ui.request.api.config.ConfigFeign; +import de.saxsys.mvvmfx.ViewModel; +import de.saxsys.mvvmfx.utils.mapping.ModelWrapper; +import io.datafx.core.concurrent.ProcessChain; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.StringProperty; + +import java.util.Optional; + +import static com.lw.ui.utils.DictTypeEnum.INFRA_BOOLEAN_STRING; + +public class ConfigFormViewModel implements ViewModel { + + private ModelWrapper wrapper = new ModelWrapper<>(); + private ObjectProperty visbleSel = new SimpleObjectProperty<>(); + + + public ConfigFormViewModel() { + } + + public ConfigSaveReqVO getSaveReqVO() { + visibleProperty().set(Convert.toBool(visbleSel.get().getValue(),false)); + wrapper.commit(); + return wrapper.get(); + } + + + public void query(Long id) { + + ProcessChain.create() + .addSupplierInExecutor(() -> { + if (id == null) { + return new ConfigSaveReqVO(); + } + return Request.connector(ConfigFeign.class).getConfig(id).getData(); + }) + .addConsumerInPlatformThread(r -> { + ConfigSaveReqVO reqVO = new ConfigSaveReqVO(); + BeanUtil.copyProperties(r, reqVO); + setValue(reqVO); + + }) + .onException(e -> e.printStackTrace()) + .run(); + } + + /** + * 系统设置菜单 + */ + public void setValue(ConfigSaveReqVO roleRespVO) { + DictDataSimpleRespVO sel = AppStore.getDictDataValueMap(INFRA_BOOLEAN_STRING).get(Optional.ofNullable(roleRespVO).map(ConfigSaveReqVO::getVisible).orElse(false) + ""); + visbleSel.set(sel); + wrapper.set(roleRespVO); + wrapper.reload(); + } + + public CommonResult save(boolean isAdd) { + + if (isAdd) { + return Request.connector(ConfigFeign.class).createConfig(getSaveReqVO()); + } else { + return Request.connector(ConfigFeign.class).updateConfig(getSaveReqVO()); + } + } + + public StringProperty nameProperty() { + return wrapper.field("name", ConfigSaveReqVO::getName, ConfigSaveReqVO::setName, ""); + } + + public StringProperty categoryProperty() { + return wrapper.field("category", ConfigSaveReqVO::getCategory, ConfigSaveReqVO::setCategory, ""); + } + + public StringProperty keyProperty() { + return wrapper.field("key", ConfigSaveReqVO::getKey, ConfigSaveReqVO::setKey); + } + + public StringProperty valueProperty() { + return wrapper.field("value", ConfigSaveReqVO::getValue, ConfigSaveReqVO::setValue); + } + + public BooleanProperty visibleProperty() { + return wrapper.field("visible", ConfigSaveReqVO::getVisible, ConfigSaveReqVO::setVisible); + } + + + public StringProperty remartProperty() { + return wrapper.field("remark", ConfigSaveReqVO::getRemark, ConfigSaveReqVO::setRemark); + } + + public DictDataSimpleRespVO getVisbleSel() { + return visbleSel.get(); + } + + public ObjectProperty visbleSelProperty() { + return visbleSel; + } + + public void setVisbleSel(DictDataSimpleRespVO visbleSel) { + this.visbleSel.set(visbleSel); + } +} + diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigView.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigView.java new file mode 100644 index 0000000..a95cf6b --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigView.java @@ -0,0 +1,377 @@ +package com.lw.fx.view.infra.config; + +import cn.hutool.core.date.DateUtil; +import com.dlsc.gemsfx.DialogPane; +import com.lw.dillon.admin.module.infra.controller.admin.config.vo.ConfigRespVO; +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.request.Request; +import com.lw.fx.store.AppStore; +import com.lw.fx.util.MessageType; +import com.lw.fx.view.control.PagingControl; +import com.lw.fx.view.control.WFXGenericDialog; +import com.lw.ui.request.api.config.ConfigFeign; +import de.saxsys.mvvmfx.*; +import io.datafx.core.concurrent.ProcessChain; +import javafx.collections.FXCollections; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.layout.HBox; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; +import javafx.util.Callback; +import org.kordamp.ikonli.feather.Feather; +import org.kordamp.ikonli.javafx.FontIcon; + +import java.net.URL; +import java.time.LocalDateTime; +import java.util.Map; +import java.util.ResourceBundle; + +import static atlantafx.base.theme.Styles.*; +import static com.lw.ui.utils.DictTypeEnum.INFRA_BOOLEAN_STRING; +import static com.lw.ui.utils.DictTypeEnum.INFRA_CONFIG_TYPE; + +public class ConfigView implements FxmlView, Initializable { + + @InjectViewModel + private ConfigViewModel viewModel; + @FXML + private Button addBut; + + @FXML + private TableColumn categoryCol; + + @FXML + private TextField keyField; + + @FXML + private VBox contentPane; + + @FXML + private TableColumn createTimeCol; + + @FXML + private DatePicker endDatePicker; + + @FXML + private TableColumn idCol; + + @FXML + private TableColumn keyCol; + + @FXML + private TableColumn nameCol; + + @FXML + private TextField nameField; + + @FXML + private TableColumn optCol; + + @FXML + private TableColumn remarkCol; + + @FXML + private Button resetBut; + + @FXML + private StackPane rootPane; + + @FXML + private Button searchBut; + + @FXML + private DatePicker startDatePicker; + + @FXML + private ComboBox typeCombo; + + @FXML + private TableView tableView; + + @FXML + private TableColumn typeCol; + + @FXML + private TableColumn valueCol; + + @FXML + private TableColumn visibleCol; + + private PagingControl pagingControl; + + private DialogPane dialogPane; + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + dialogPane = new DialogPane(); + rootPane.getChildren().add(dialogPane); + pagingControl = new PagingControl(); + contentPane.getChildren().add(pagingControl); + + pagingControl.totalProperty().bind(viewModel.totalProperty()); + viewModel.pageNumProperty().bind(pagingControl.pageNumProperty()); + viewModel.pageSizeProperty().bind(pagingControl.pageSizeProperty()); + pagingControl.pageNumProperty().addListener((observable, oldValue, newValue) -> { + viewModel.loadTableData(); + }); + + pagingControl.pageSizeProperty().addListener((observable, oldValue, newValue) -> { + viewModel.loadTableData(); + }); + + + idCol.setCellValueFactory(new PropertyValueFactory<>("id")); + idCol.setStyle("-fx-alignment: CENTER"); + + categoryCol.setCellValueFactory(new PropertyValueFactory<>("category")); + categoryCol.setStyle("-fx-alignment: CENTER"); + + nameCol.setCellValueFactory(new PropertyValueFactory<>("name")); + nameCol.setStyle("-fx-alignment: CENTER"); + + keyCol.setCellValueFactory(new PropertyValueFactory<>("key")); + keyCol.setStyle("-fx-alignment: CENTER"); + + valueCol.setCellValueFactory(new PropertyValueFactory<>("value")); + valueCol.setStyle("-fx-alignment: CENTER"); + + visibleCol.setCellValueFactory(new PropertyValueFactory<>("visible")); + visibleCol.setStyle("-fx-alignment: CENTER"); + visibleCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(Boolean item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(INFRA_BOOLEAN_STRING).get(item + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + + HBox box = new HBox(state); + box.setPadding(new Insets(7, 7, 7, 7)); + box.setAlignment(Pos.CENTER); + setGraphic(box); + + + } + + } + }; + } + }); + createTimeCol.setCellValueFactory(new PropertyValueFactory<>("createTime")); + createTimeCol.setStyle("-fx-alignment: CENTER"); + + typeCol.setCellValueFactory(new PropertyValueFactory<>("type")); + typeCol.setStyle("-fx-alignment: CENTER"); + typeCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(Integer item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + + DictDataSimpleRespVO dict = AppStore.getDictDataValueMap(INFRA_CONFIG_TYPE).get(item + ""); + Button state = new Button(dict.getLabel()); + switch (dict.getColorType()) { + case "primary": + state.getStyleClass().addAll(BUTTON_OUTLINED, ACCENT); + break; + case "success": + state.getStyleClass().addAll(BUTTON_OUTLINED, SUCCESS); + break; + case "info": + state.getStyleClass().addAll(BUTTON_OUTLINED); + break; + case "warning": + state.getStyleClass().addAll(BUTTON_OUTLINED, WARNING); + break; + case "danger": + state.getStyleClass().addAll(BUTTON_OUTLINED, DANGER); + break; + default: + state.getStyleClass().addAll(BUTTON_OUTLINED); + } + + HBox box = new HBox(state); + box.setPadding(new Insets(7, 7, 7, 7)); + box.setAlignment(Pos.CENTER); + setGraphic(box); + + + } + + } + }; + } + }); + + remarkCol.setCellValueFactory(new PropertyValueFactory<>("remark")); + remarkCol.setStyle("-fx-alignment: CENTER"); + + createTimeCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + return new TableCell<>() { + @Override + protected void updateItem(LocalDateTime item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + } else { + if (item != null) { + this.setText(DateUtil.format(item, "yyyy-MM-dd HH:mm:ss")); + } + } + + } + }; + } + }); + + optCol.setCellValueFactory(new PropertyValueFactory<>("id")); + optCol.setCellFactory(new Callback, TableCell>() { + @Override + public TableCell call(TableColumn param) { + + TableCell cell = new TableCell() { + @Override + protected void updateItem(Long item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + + Button editBut = new Button("修改"); + editBut.setOnAction(event -> showFormView(getTableRow().getItem().getId())); + editBut.setGraphic(FontIcon.of(Feather.EDIT)); + editBut.getStyleClass().addAll(FLAT, ACCENT); + + Button delBut = new Button("删除"); + delBut.setOnAction(actionEvent -> showDelDialog(getTableRow().getItem())); + delBut.setGraphic(FontIcon.of(Feather.TRASH)); + delBut.getStyleClass().addAll(FLAT, DANGER); + HBox box = new HBox(editBut, delBut); + box.setAlignment(Pos.CENTER); +// box.setSpacing(7); + setGraphic(box); + } + } + }; + return cell; + } + }); + tableView.itemsProperty().bind(viewModel.tableItemsProperty()); + + nameField.textProperty().bindBidirectional(viewModel.nameProperty()); + keyField.textProperty().bindBidirectional(viewModel.keyProperty()); + + + searchBut.setOnAction(actionEvent -> viewModel.loadTableData()); + resetBut.setOnAction(actionEvent -> { + nameField.setText(null); + keyField.setText(null); + typeCombo.getSelectionModel().select(null); + startDatePicker.setValue(null); + endDatePicker.setValue(null); + viewModel.loadTableData(); + }); + startDatePicker.valueProperty().bindBidirectional(viewModel.beginDateProperty()); + endDatePicker.valueProperty().bindBidirectional(viewModel.endDateProperty()); + + addBut.setOnAction(actionEvent -> showFormView(null)); + + typeCombo.setItems(FXCollections.observableArrayList(AppStore.getDictDataList(INFRA_CONFIG_TYPE))); + typeCombo.valueProperty().bindBidirectional(viewModel.typeProperty()); + } + + + /** + * 显示编辑对话框 + */ + private void showFormView(Long id) { + WFXGenericDialog dialog = new WFXGenericDialog(); + + boolean isAdd = (id == null); + ViewTuple load = FluentViewLoader.fxmlView(ConfigFormView.class).load(); + load.getViewModel().query(id); + dialog.addActions(Map.entry(new Button("取消"), event -> dialog.close()), Map.entry(new Button("确定"), event -> { + ProcessChain.create().addSupplierInExecutor(() -> { + return load.getViewModel().save(isAdd); + }).addConsumerInPlatformThread(r -> { + if (r.isSuccess()) { + MvvmFX.getNotificationCenter().publish("message", "保存成功", MessageType.SUCCESS); + + dialog.close(); + viewModel.loadTableData(); + + } + }).onException(e -> e.printStackTrace()).run(); + })); + + dialog.setHeaderIcon(FontIcon.of(Feather.INFO)); + dialog.setHeaderText(id != null ? "编辑配置" : "添加配置"); + dialog.setContent(load.getView()); + dialog.show(rootPane.getScene()); + + } + + + private void showDelDialog(ConfigRespVO respVO) { + WFXGenericDialog dialog = new WFXGenericDialog(); + dialog.setHeaderIcon(FontIcon.of(Feather.INFO)); + dialog.setHeaderText("删除配置"); + dialog.addActions(Map.entry(new Button("取消"), event -> dialog.close()), Map.entry(new Button("确定"), event -> { + ProcessChain.create().addSupplierInExecutor(() -> { + return Request.connector(ConfigFeign.class).deleteConfig(respVO.getId()); + }).addConsumerInPlatformThread(r -> { + if (r.isSuccess()) { + MvvmFX.getNotificationCenter().publish("message", "删除成功", MessageType.SUCCESS); + + dialog.close(); + viewModel.loadTableData(); + } + }).onException(e -> e.printStackTrace()).run(); + })); + + dialog.setContent(new Label("是否确认删除名称为" + respVO.getName() + "的数据项?")); + dialog.show(rootPane.getScene()); + } +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigViewModel.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigViewModel.java new file mode 100644 index 0000000..b41b902 --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/infra/config/ConfigViewModel.java @@ -0,0 +1,156 @@ +package com.lw.fx.view.infra.config; + +import cn.hutool.core.util.ObjectUtil; +import com.lw.dillon.admin.module.infra.controller.admin.config.vo.ConfigRespVO; +import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import com.lw.fx.request.Request; +import com.lw.ui.request.api.config.ConfigFeign; +import de.saxsys.mvvmfx.SceneLifecycle; +import de.saxsys.mvvmfx.ViewModel; +import io.datafx.core.concurrent.ProcessChain; +import javafx.beans.property.*; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class ConfigViewModel implements ViewModel, SceneLifecycle { + + private SimpleIntegerProperty total = new SimpleIntegerProperty(0); + private IntegerProperty pageNum = new SimpleIntegerProperty(0); + private IntegerProperty pageSize = new SimpleIntegerProperty(10); + + private ObjectProperty> tableItems = new SimpleObjectProperty<>(); + + private ObjectProperty beginDate = new SimpleObjectProperty<>(); + private ObjectProperty endDate = new SimpleObjectProperty<>(); + private StringProperty name = new SimpleStringProperty(); + private StringProperty key = new SimpleStringProperty(); + private ObjectProperty type = new SimpleObjectProperty<>(); + + public ConfigViewModel() { + + loadTableData(); + } + + + + public void loadTableData() { + + Map queryMap = new HashMap<>(); + queryMap.put("pageNo", pageNum.get() + 1); + queryMap.put("pageSize", pageSize.get()); + + queryMap.put("name", name.get()); + queryMap.put("key", key.get()); + queryMap.put("type", Optional.ofNullable(type.get()).map(DictDataSimpleRespVO::getValue).orElse(null)); + + + if (ObjectUtil.isAllNotEmpty(getBeginDate(), getEndDate())) { + String sd = getBeginDate().atTime(0, 0, 0).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + String ed = getEndDate().atTime(23, 59, 59).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + queryMap.put("createTime", new String[]{sd, ed}); + } + + ProcessChain.create() + .addSupplierInExecutor(() -> Request.connector(ConfigFeign.class).getConfigPage(queryMap)) + .addConsumerInPlatformThread(listCommonResult -> { + + if (listCommonResult.isSuccess()) { + ObservableList userRespVOS = FXCollections.observableArrayList(); + userRespVOS.addAll(listCommonResult.getData().getList()); + tableItems.set(userRespVOS); + totalProperty().set(listCommonResult.getData().getTotal().intValue()); + } + }) + .run(); + + + } + + + + + public ObjectProperty> tableItemsProperty() { + return tableItems; + } + + public DictDataSimpleRespVO getType() { + return type.get(); + } + + public ObjectProperty typeProperty() { + return type; + } + + public String getName() { + return name.get(); + } + + public StringProperty nameProperty() { + return name; + } + + public String getKey() { + return key.get(); + } + + public StringProperty keyProperty() { + return key; + } + + public LocalDate getBeginDate() { + return beginDate.get(); + } + + public ObjectProperty beginDateProperty() { + return beginDate; + } + + public LocalDate getEndDate() { + return endDate.get(); + } + + public ObjectProperty endDateProperty() { + return endDate; + } + + + public int getTotal() { + return total.get(); + } + + public SimpleIntegerProperty totalProperty() { + return total; + } + + public int getPageNum() { + return pageNum.get(); + } + + public IntegerProperty pageNumProperty() { + return pageNum; + } + + public int getPageSize() { + return pageSize.get(); + } + + public IntegerProperty pageSizeProperty() { + return pageSize; + } + + @Override + public void onViewAdded() { + + } + + @Override + public void onViewRemoved() { + + } +} diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/system/loginlog/LoginLogView.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/system/loginlog/LoginLogView.java index 413fec9..6c1b234 100644 --- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/system/loginlog/LoginLogView.java +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/view/system/loginlog/LoginLogView.java @@ -294,6 +294,7 @@ public class LoginLogView implements FxmlView, Initializable userIpField.setText(null); startDatePicker.setValue(null); endDatePicker.setValue(null); + viewModel.loadTableData(); }); startDatePicker.valueProperty().bindBidirectional(viewModel.beginDateProperty()); endDatePicker.valueProperty().bindBidirectional(viewModel.endDateProperty()); diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/websocket/SSLWebSocketClient.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/websocket/SSLWebSocketClient.java index 75b8d6d..4724cd1 100644 --- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/websocket/SSLWebSocketClient.java +++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/websocket/SSLWebSocketClient.java @@ -2,14 +2,9 @@ package com.lw.fx.websocket; import com.lw.dillon.admin.framework.common.util.json.JsonUtils; import com.lw.dillon.admin.framework.websocket.core.message.JsonWebSocketMessage; -import com.lw.dillon.admin.module.system.controller.admin.notice.vo.NoticeRespVO; -import com.lw.fx.request.Request; import com.lw.fx.store.AppStore; -import com.lw.fx.util.MessageType; -import com.lw.ui.request.api.system.AuthFeign; import de.saxsys.mvvmfx.MvvmFX; import io.datafx.core.concurrent.ProcessChain; -import javafx.application.Platform; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.java_websocket.client.WebSocketClient; diff --git a/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/apilog/ApiAccessLogView.fxml b/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/apilog/ApiAccessLogView.fxml new file mode 100644 index 0000000..165a63a --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/apilog/ApiAccessLogView.fxml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/apilog/ApiErrorLogView.fxml b/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/apilog/ApiErrorLogView.fxml new file mode 100644 index 0000000..81f84be --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/apilog/ApiErrorLogView.fxml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/config/ConfigFormView.fxml b/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/config/ConfigFormView.fxml new file mode 100644 index 0000000..e210be4 --- /dev/null +++ b/dillon-ui/dillon-ui-fx/src/main/resources/com/lw/fx/view/infra/config/ConfigFormView.fxml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +