Author SHA1 Message Date
gaoyutao 92cf598941 修复列表管理网卡信息不显示问题。
修复多网卡图形监控异常问题。
2025-12-18 15:28:25 +08:00
gaoyutao 343028ade5 1、优化子网卡流量图形展示。
2、优化接口名称存储逻辑,减少死锁。
3、增加cpu利用率内存利用率字段。
2025-12-17 18:18:19 +08:00
gaoyutao 597b5dad01 修复服务器、交换机月收益不展示95值问题。 2025-12-16 20:59:40 +08:00
gaoyutao e818c0319e 修复图形x轴时间跨界问题、交换机月收益不展示95值问题。
ipv4 ipv6增加子网卡统计
2025-12-16 17:56:49 +08:00
gaoyutao 6d3b5201e0 增加存储子网卡信息、修复子网卡流量递增问题
子网卡流量图合并
2025-12-15 19:50:44 +08:00
gaoyutao 9a81408ada 更改业务IP绑定、静态路由添加逻辑。
拓扑管理对端交换机名称处理
2025-12-12 15:43:16 +08:00
gaoyutao f3bdfbc6bf 1、定位并解决收益未自动生成问题。
2、优化服务器列表筛选条件查询速度。
2025-12-11 19:18:59 +08:00
gaoyutao 2eaf62ea82 优化服务器列表查询速度、筛选条件bug修复。
ipv4、ipv6初始流量处理。
增加日志排查收益未自动生成问题。
2025-12-10 18:32:07 +08:00
gaoyutao 13e51c11e1 权限控制优化 2025-12-09 19:25:51 +08:00
gaoyutao 1f133e8c05 权限控制增加
优化ipv4、ipv6流量展示
2025-12-08 19:23:53 +08:00
gaoyutao cd8cafaf3f 优化服务器管理详情 2025-12-05 20:00:38 +08:00
gaoyutao cbf017a8e2 优化排序和查询速度 2025-12-05 19:46:35 +08:00
gaoyutao 802e668d9a 相关接口增加ipv4、ipv6出入流量字段。
服务器管理列表新增字段和排序。
优化监控看板流量统计。
2025-12-05 18:59:02 +08:00
gaoyutao 9dee067a87 服务器流量增加ipv4、ipv6协议区分 2025-12-04 18:26:48 +08:00
gaoyutao a5b5f5b08d 1、mtr探测设备增加并发限制。
2、开发防火墙策略区分ipv4和ipv6。
3、脚本执行策略下发时间优化。
2025-12-03 19:18:12 +08:00
gaoyutao a40a6f344e 优化执行结果查看分页 2025-12-02 18:41:18 +08:00
gaoyutao 7d26d2fb3b 优化mtr探测策略、增加ipv6相关字段 2025-12-01 18:15:46 +08:00
gaoyutao ed6c0a4c80 优化mtr探测策略 2025-11-28 18:44:20 +08:00
gaoyutao 2f8fd79de5 优化mtr探测策略
告警日志增加业务名称、告警推送是否成功字段
2025-11-27 18:36:33 +08:00
gaoyutao 31e1f7f8dc 修复网卡信息有变动saas平台未及时更新、脚本策略下发未返回结果bug。
优化mtr探测策略
2025-11-26 18:13:26 +08:00
gaoyutao afbf1eead0 服务器管理添加标签功能。
优化mtr探测结果存储。
2025-11-25 18:18:51 +08:00
gaoyutao a0b0b57110 初始化README 2025-11-24 16:27:05 +08:00
gaoyutao de49404116 初始化v1.2 2025-11-24 16:19:09 +08:00
932 changed files with 8779 additions and 7473 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 若依
Copyright (c) 2020 彤然
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+23 -100
View File
@@ -1,52 +1,29 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-b99b286755aef70355a7084753f89cdb7c9.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.6.6</h1>
<h4 align="center">基于 Vue/Element UI 和 Spring Boot/Spring Cloud & Alibaba 前后端分离的分布式微服务架构</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-Cloud/stargazers"><img src="https://gitee.com/y_project/RuoYi-Cloud/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Cloud"><img src="https://img.shields.io/badge/RuoYi-v3.6.6-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Cloud/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 采用前后端分离的模式,微服务版本前端(基于 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue))。
* 后端采用Spring Boot、Spring Cloud & Alibaba。
* 注册中心、配置中心选型Nacos,权限认证使用Redis。
* 流量控制框架选型Sentinel,分布式事务选型Seata。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[RuoYi-Cloud-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Cloud-Vue3),保持同步更新。
* 如需不分离应用,请移步 [RuoYi](https://gitee.com/y_project/RuoYi),如需分离应用,请移步 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)
* 阿里云优惠券:[点我进入](http://aly.ruoyi.vip),腾讯云优惠券:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
## 系统模块
~~~
com.ruoyi
├── ruoyi-ui // 前端框架 [80]
├── ruoyi-gateway // 网关模块 [8080]
├── ruoyi-auth // 认证中心 [9200]
├── ruoyi-api // 接口模块
│ └── ruoyi-api-system // 系统接口
├── ruoyi-common // 通用模块
│ └── ruoyi-common-core // 核心模块
│ └── ruoyi-common-datascope // 权限范围
│ └── ruoyi-common-datasource // 多数据源
│ └── ruoyi-common-log // 日志记录
│ └── ruoyi-common-redis // 缓存服务
│ └── ruoyi-common-seata // 分布式事务
│ └── ruoyi-common-security // 安全模块
│ └── ruoyi-common-sensitive // 数据脱敏
│ └── ruoyi-common-swagger // 系统接口
├── ruoyi-modules // 业务模块
│ └── ruoyi-system // 系统模块 [9201]
│ └── ruoyi-gen // 代码生成 [9202]
│ └── ruoyi-job // 定时任务 [9203]
│ └── ruoyi-file // 文件服务 [9300]
├── ruoyi-visual // 图形化管理模块
│ └── ruoyi-visual-monitor // 监控中心 [9100]
com.tongran
├── tongran-ui // 前端框架 [80]
├── tongran-gateway // 网关模块 [8080]
├── tongran-auth // 认证中心 [9200]
├── tongran-api // 接口模块
│ └── tongran-api-system // 系统接口
├── tongran-common // 通用模块
│ └── tongran-common-core // 核心模块
│ └── tongran-common-datascope // 权限范围
│ └── tongran-common-datasource // 多数据源
│ └── tongran-common-log // 日志记录
│ └── tongran-common-redis // 缓存服务
│ └── tongran-common-seata // 分布式事务
│ └── tongran-common-security // 安全模块
│ └── tongran-common-sensitive // 数据脱敏
│ └── tongran-common-swagger // 系统接口
├── tongran-modules // 业务模块
│ └── tongran-system // 系统模块 [9201]
│ └── tongran-gen // 代码生成 [9202]
│ └── tongran-job // 定时任务 [9203]
│ └── tongran-file // 文件服务 [9300]
├── tongran-visual // 图形化管理模块
│ └── tongran-visual-monitor // 监控中心 [9100]
├──pom.xml // 公共依赖
~~~
@@ -73,57 +50,3 @@ com.ruoyi
15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 在线构建器:拖动表单元素生成相应的HTML代码。
17. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
## 在线体验
- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
演示地址:http://ruoyi.vip
文档地址:http://doc.ruoyi.vip
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-4148b24f58660a9dc347761e4cf6162f28f.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-ece3fd37a3d4bb75a3926e905a3c5629055.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-92ffb7f3835855cff100fa0f754a6be0d99.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-ff9e3066561574aca73005c5730c6a41f15.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依微服务交流群
QQ群: [![加入QQ群](https://img.shields.io/badge/已满-42799195-blue.svg)](https://jq.qq.com/?_wv=1027&k=yqInfq0S) [![加入QQ群](https://img.shields.io/badge/已满-170157040-blue.svg)](https://jq.qq.com/?_wv=1027&k=Oy1mb3p8) [![加入QQ群](https://img.shields.io/badge/已满-130643120-blue.svg)](https://jq.qq.com/?_wv=1027&k=rvxkJtXK) [![加入QQ群](https://img.shields.io/badge/已满-225920371-blue.svg)](https://jq.qq.com/?_wv=1027&k=0Ck3PvTe) [![加入QQ群](https://img.shields.io/badge/已满-201705537-blue.svg)](https://jq.qq.com/?_wv=1027&k=FnHHP4TT) [![加入QQ群](https://img.shields.io/badge/已满-236543183-blue.svg)](https://jq.qq.com/?_wv=1027&k=qdT1Ojpz) [![加入QQ群](https://img.shields.io/badge/已满-213618602-blue.svg)](https://jq.qq.com/?_wv=1027&k=nw3OiyXs) [![加入QQ群](https://img.shields.io/badge/已满-148794840-blue.svg)](https://jq.qq.com/?_wv=1027&k=kiU5WDls) [![加入QQ群](https://img.shields.io/badge/已满-118752664-blue.svg)](https://jq.qq.com/?_wv=1027&k=MtBy6YfT) [![加入QQ群](https://img.shields.io/badge/已满-101038945-blue.svg)](https://jq.qq.com/?_wv=1027&k=FqImHgH2) [![加入QQ群](https://img.shields.io/badge/已满-128355254-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=G4jZ4EtdT50PhnMBudTnEwgonxkXOscJ&authKey=FkGHYfoTKlGE6wHdKdjH9bVoOgQjtLP9WM%2Fj7pqGY1msoqw9uxDiBo39E2mLgzYg&noverify=0&group_code=128355254) [![加入QQ群](https://img.shields.io/badge/已满-179219821-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=irnwcXhbLOQEv1g-TwGifjNTA_f4wZiA&authKey=4bpzEwhcUY%2FvsPDHvzYn6xfoS%2FtOArvZ%2BGXzfr7O0%2FEqLfkKA%2BuCDXlzHIFg8t93&noverify=0&group_code=179219821) [![加入QQ群](https://img.shields.io/badge/已满-158753145-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=lx1uEdEDuxeM7rUvF3qmlFdqKqdJ5Z-R&authKey=rgyPW9yhhh4IIURKVFa6NgP3qiqH04WAzrJ0trsgkr3pjzm6sKIOGyA58oOjoj%2FJ&noverify=0&group_code=158753145) [![加入QQ群](https://img.shields.io/badge/112869560-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Kuaw0Xdlw2Nlgn6s8h9elzuquHGxGObD&authKey=cSrQcWQ%2BzQZAFFrwxaR%2BbzcumX4WRduZnd1O6JO1dlclQMiu%2BKwxAy8t2JfNp67V&noverify=0&group_code=112869560) 点击按钮入群。
+3 -3
View File
@@ -1,14 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Auth工程。
echo [Ϣ] ʹJarAuth̡
echo.
cd %~dp0
cd ../ruoyi-auth/target
cd ../tongran-auth/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-auth.jar
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar tongran-auth.jar
cd bin
pause
+3 -3
View File
@@ -1,14 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Gateway工程。
echo [Ϣ] ʹJarGateway̡
echo.
cd %~dp0
cd ../ruoyi-gateway/target
cd ../tongran-gateway/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-gateway.jar
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar tongran-gateway.jar
cd bin
pause
+3 -3
View File
@@ -1,14 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Modules-File工程。
echo [Ϣ] ʹJarModules-File̡
echo.
cd %~dp0
cd ../ruoyi-modules/ruoyi-file/target
cd ../tongran-modules/tongran-file/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-file.jar
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar tongran-modules-file.jar
cd bin
pause
+3 -3
View File
@@ -1,14 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Modules-Gen工程。
echo [Ϣ] ʹJarModules-Gen̡
echo.
cd %~dp0
cd ../ruoyi-modules/ruoyi-gen/target
cd ../tongran-modules/tongran-gen/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-gen.jar
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar tongran-modules-gen.jar
cd bin
pause
+3 -3
View File
@@ -1,14 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Modules-Job工程。
echo [Ϣ] ʹJarModules-Job̡
echo.
cd %~dp0
cd ../ruoyi-modules/ruoyi-job/target
cd ../tongran-modules/tongran-job/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-job.jar
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar tongran-modules-job.jar
cd bin
pause
+3 -3
View File
@@ -1,14 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Modules-System工程。
echo [Ϣ] ʹJarModules-System̡
echo.
cd %~dp0
cd ../ruoyi-modules/ruoyi-system/target
cd ../tongran-modules/tongran-system/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-system.jar
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar tongran-modules-system.jar
cd bin
pause
+3 -3
View File
@@ -1,14 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Monitor工程。
echo [Ϣ] ʹJarMonitor̡
echo.
cd %~dp0
cd ../ruoyi-visual/ruoyi-monitor/target
cd ../tongran-visual/tongran-monitor/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-visual-monitor.jar
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar tongran-visual-monitor.jar
cd bin
pause
+15 -15
View File
@@ -14,28 +14,28 @@ cp ../sql/ry_config_20250224.sql ./mysql/db
# copy html
echo "begin copy html "
cp -r ../ruoyi-ui/dist/** ./nginx/html/dist
cp -r ../tongran-ui/dist/** ./nginx/html/dist
# copy jar
echo "begin copy ruoyi-gateway "
cp ../ruoyi-gateway/target/ruoyi-gateway.jar ./ruoyi/gateway/jar
echo "begin copy tongran-gateway "
cp ../tongran-gateway/target/tongran-gateway.jar ./tongran/gateway/jar
echo "begin copy ruoyi-auth "
cp ../ruoyi-auth/target/ruoyi-auth.jar ./ruoyi/auth/jar
echo "begin copy tongran-auth "
cp ../tongran-auth/target/tongran-auth.jar ./tongran/auth/jar
echo "begin copy ruoyi-visual "
cp ../ruoyi-visual/ruoyi-monitor/target/ruoyi-visual-monitor.jar ./ruoyi/visual/monitor/jar
echo "begin copy tongran-visual "
cp ../tongran-visual/tongran-monitor/target/tongran-visual-monitor.jar ./tongran/visual/monitor/jar
echo "begin copy ruoyi-modules-system "
cp ../ruoyi-modules/ruoyi-system/target/ruoyi-modules-system.jar ./ruoyi/modules/system/jar
echo "begin copy tongran-modules-system "
cp ../tongran-modules/tongran-system/target/tongran-modules-system.jar ./tongran/modules/system/jar
echo "begin copy ruoyi-modules-file "
cp ../ruoyi-modules/ruoyi-file/target/ruoyi-modules-file.jar ./ruoyi/modules/file/jar
echo "begin copy tongran-modules-file "
cp ../tongran-modules/tongran-file/target/tongran-modules-file.jar ./tongran/modules/file/jar
echo "begin copy ruoyi-modules-job "
cp ../ruoyi-modules/ruoyi-job/target/ruoyi-modules-job.jar ./ruoyi/modules/job/jar
echo "begin copy tongran-modules-job "
cp ../tongran-modules/tongran-job/target/tongran-modules-job.jar ./tongran/modules/job/jar
echo "begin copy ruoyi-modules-gen "
cp ../ruoyi-modules/ruoyi-gen/target/ruoyi-modules-gen.jar ./ruoyi/modules/gen/jar
echo "begin copy tongran-modules-gen "
cp ../tongran-modules/tongran-gen/target/tongran-modules-gen.jar ./tongran/modules/gen/jar
+2 -2
View File
@@ -26,12 +26,12 @@ port(){
# 启动基础环境(必须)
base(){
docker-compose up -d ruoyi-mysql ruoyi-redis ruoyi-nacos
docker-compose up -d tongran-mysql tongran-redis tongran-nacos
}
# 启动程序模块(必须)
modules(){
docker-compose up -d ruoyi-nginx ruoyi-gateway ruoyi-auth ruoyi-modules-system
docker-compose up -d tongran-nginx tongran-gateway tongran-auth tongran-modules-system
}
# 关闭所有环境/模块
+48 -48
View File
@@ -1,7 +1,7 @@
version : '3.8'
services:
ruoyi-nacos:
container_name: ruoyi-nacos
tongran-nacos:
container_name: tongran-nacos
image: nacos/nacos-server
build:
context: ./nacos
@@ -15,9 +15,9 @@ services:
- "9848:9848"
- "9849:9849"
depends_on:
- ruoyi-mysql
ruoyi-mysql:
container_name: ruoyi-mysql
- tongran-mysql
tongran-mysql:
container_name: tongran-mysql
image: mysql:5.7
build:
context: ./mysql
@@ -38,103 +38,103 @@ services:
environment:
MYSQL_DATABASE: 'ry-cloud'
MYSQL_ROOT_PASSWORD: password
ruoyi-redis:
container_name: ruoyi-redis
tongran-redis:
container_name: tongran-redis
image: redis
build:
context: ./redis
ports:
- "6379:6379"
volumes:
- ./redis/conf/redis.conf:/home/ruoyi/redis/redis.conf
- ./redis/conf/redis.conf:/home/tongran/redis/redis.conf
- ./redis/data:/data
command: redis-server /home/ruoyi/redis/redis.conf
ruoyi-nginx:
container_name: ruoyi-nginx
command: redis-server /home/tongran/redis/redis.conf
tongran-nginx:
container_name: tongran-nginx
image: nginx
build:
context: ./nginx
ports:
- "80:80"
volumes:
- ./nginx/html/dist:/home/ruoyi/projects/ruoyi-ui
- ./nginx/html/dist:/home/tongran/projects/tongran-ui
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/logs:/var/log/nginx
- ./nginx/conf.d:/etc/nginx/conf.d
depends_on:
- ruoyi-gateway
- tongran-gateway
links:
- ruoyi-gateway
ruoyi-gateway:
container_name: ruoyi-gateway
- tongran-gateway
tongran-gateway:
container_name: tongran-gateway
build:
context: ./ruoyi/gateway
context: ./tongran/gateway
dockerfile: dockerfile
ports:
- "8080:8080"
depends_on:
- ruoyi-redis
- tongran-redis
links:
- ruoyi-redis
ruoyi-auth:
container_name: ruoyi-auth
- tongran-redis
tongran-auth:
container_name: tongran-auth
build:
context: ./ruoyi/auth
context: ./tongran/auth
dockerfile: dockerfile
ports:
- "9200:9200"
depends_on:
- ruoyi-redis
- tongran-redis
links:
- ruoyi-redis
ruoyi-modules-system:
container_name: ruoyi-modules-system
- tongran-redis
tongran-modules-system:
container_name: tongran-modules-system
build:
context: ./ruoyi/modules/system
context: ./tongran/modules/system
dockerfile: dockerfile
ports:
- "9201:9201"
depends_on:
- ruoyi-redis
- ruoyi-mysql
- tongran-redis
- tongran-mysql
links:
- ruoyi-redis
- ruoyi-mysql
ruoyi-modules-gen:
container_name: ruoyi-modules-gen
- tongran-redis
- tongran-mysql
tongran-modules-gen:
container_name: tongran-modules-gen
build:
context: ./ruoyi/modules/gen
context: ./tongran/modules/gen
dockerfile: dockerfile
ports:
- "9202:9202"
depends_on:
- ruoyi-mysql
- tongran-mysql
links:
- ruoyi-mysql
ruoyi-modules-job:
container_name: ruoyi-modules-job
- tongran-mysql
tongran-modules-job:
container_name: tongran-modules-job
build:
context: ./ruoyi/modules/job
context: ./tongran/modules/job
dockerfile: dockerfile
ports:
- "9203:9203"
depends_on:
- ruoyi-mysql
- tongran-mysql
links:
- ruoyi-mysql
ruoyi-modules-file:
container_name: ruoyi-modules-file
- tongran-mysql
tongran-modules-file:
container_name: tongran-modules-file
build:
context: ./ruoyi/modules/file
context: ./tongran/modules/file
dockerfile: dockerfile
ports:
- "9300:9300"
volumes:
- ./ruoyi/uploadPath:/home/ruoyi/uploadPath
ruoyi-visual-monitor:
container_name: ruoyi-visual-monitor
- ./tongran/uploadPath:/home/tongran/uploadPath
tongran-visual-monitor:
container_name: tongran-visual-monitor
build:
context: ./ruoyi/visual/monitor
context: ./tongran/visual/monitor
dockerfile: dockerfile
ports:
- "9100:9100"
+1 -1
View File
@@ -1,7 +1,7 @@
# 基础镜像
FROM mysql:5.7
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 执行sql脚本
ADD ./db/*.sql /docker-entrypoint-initdb.d/
+2 -2
View File
@@ -1,6 +1,6 @@
spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://ruoyi-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.url.0=jdbc:mysql://tongran-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user=root
db.password=123456
@@ -16,7 +16,7 @@ management.metrics.export.influx.enabled=false
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
server.tomcat.basedir=/home/ruoyi/nacos/tomcat/logs
server.tomcat.basedir=/home/tongran/nacos/tomcat/logs
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
+1 -1
View File
@@ -1,7 +1,7 @@
# 基础镜像
FROM nacos/nacos-server
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 复制conf文件到路径
COPY ./conf/application.properties /home/nacos/conf/application.properties
+2 -2
View File
@@ -15,7 +15,7 @@ http {
server_name localhost;
location / {
root /home/ruoyi/projects/ruoyi-ui;
root /home/tongran/projects/tongran-ui;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
@@ -25,7 +25,7 @@ http {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://ruoyi-gateway:8080/;
proxy_pass http://tongran-gateway:8080/;
}
# 避免actuator暴露
+5 -5
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM nginx
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi/projects/ruoyi-ui
VOLUME /home/tongran/projects/tongran-ui
# 创建目录
RUN mkdir -p /home/ruoyi/projects/ruoyi-ui
RUN mkdir -p /home/tongran/projects/tongran-ui
# 指定路径
WORKDIR /home/ruoyi/projects/ruoyi-ui
WORKDIR /home/tongran/projects/tongran-ui
# 复制conf文件到路径
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
# 复制html文件到路径
COPY ./html/dist /home/ruoyi/projects/ruoyi-ui
COPY ./html/dist /home/tongran/projects/tongran-ui
+5 -5
View File
@@ -1,13 +1,13 @@
# 基础镜像
FROM redis
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi/redis
VOLUME /home/tongran/redis
# 创建目录
RUN mkdir -p /home/ruoyi/redis
RUN mkdir -p /home/tongran/redis
# 指定路径
WORKDIR /home/ruoyi/redis
WORKDIR /home/tongran/redis
# 复制conf文件到路径
COPY ./conf/redis.conf /home/ruoyi/redis/redis.conf
COPY ./conf/redis.conf /home/tongran/redis/redis.conf
+6 -6
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi
VOLUME /home/tongran
# 创建目录
RUN mkdir -p /home/ruoyi
RUN mkdir -p /home/tongran
# 指定路径
WORKDIR /home/ruoyi
WORKDIR /home/tongran
# 复制jar文件到路径
COPY ./jar/ruoyi-auth.jar /home/ruoyi/ruoyi-auth.jar
COPY ./jar/tongran-auth.jar /home/tongran/tongran-auth.jar
# 启动认证服务
ENTRYPOINT ["java","-jar","ruoyi-auth.jar"]
ENTRYPOINT ["java","-jar","tongran-auth.jar"]
+6 -6
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi
VOLUME /home/tongran
# 创建目录
RUN mkdir -p /home/ruoyi
RUN mkdir -p /home/tongran
# 指定路径
WORKDIR /home/ruoyi
WORKDIR /home/tongran
# 复制jar文件到路径
COPY ./jar/ruoyi-gateway.jar /home/ruoyi/ruoyi-gateway.jar
COPY ./jar/tongran-gateway.jar /home/tongran/tongran-gateway.jar
# 启动网关服务
ENTRYPOINT ["java","-jar","ruoyi-gateway.jar"]
ENTRYPOINT ["java","-jar","tongran-gateway.jar"]
+6 -6
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi
VOLUME /home/tongran
# 创建目录
RUN mkdir -p /home/ruoyi
RUN mkdir -p /home/tongran
# 指定路径
WORKDIR /home/ruoyi
WORKDIR /home/tongran
# 复制jar文件到路径
COPY ./jar/ruoyi-modules-file.jar /home/ruoyi/ruoyi-modules-file.jar
COPY ./jar/tongran-modules-file.jar /home/tongran/tongran-modules-file.jar
# 启动文件服务
ENTRYPOINT ["java","-jar","ruoyi-modules-file.jar"]
ENTRYPOINT ["java","-jar","tongran-modules-file.jar"]
+6 -6
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi
VOLUME /home/tongran
# 创建目录
RUN mkdir -p /home/ruoyi
RUN mkdir -p /home/tongran
# 指定路径
WORKDIR /home/ruoyi
WORKDIR /home/tongran
# 复制jar文件到路径
COPY ./jar/ruoyi-modules-gen.jar /home/ruoyi/ruoyi-modules-gen.jar
COPY ./jar/tongran-modules-gen.jar /home/tongran/tongran-modules-gen.jar
# 启动代码生成服务
ENTRYPOINT ["java","-jar","ruoyi-modules-gen.jar"]
ENTRYPOINT ["java","-jar","tongran-modules-gen.jar"]
+6 -6
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi
VOLUME /home/tongran
# 创建目录
RUN mkdir -p /home/ruoyi
RUN mkdir -p /home/tongran
# 指定路径
WORKDIR /home/ruoyi
WORKDIR /home/tongran
# 复制jar文件到路径
COPY ./jar/ruoyi-modules-job.jar /home/ruoyi/ruoyi-modules-job.jar
COPY ./jar/tongran-modules-job.jar /home/tongran/tongran-modules-job.jar
# 启动定时任务服务
ENTRYPOINT ["java","-jar","ruoyi-modules-job.jar"]
ENTRYPOINT ["java","-jar","tongran-modules-job.jar"]
+6 -6
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi
VOLUME /home/tongran
# 创建目录
RUN mkdir -p /home/ruoyi
RUN mkdir -p /home/tongran
# 指定路径
WORKDIR /home/ruoyi
WORKDIR /home/tongran
# 复制jar文件到路径
COPY ./jar/ruoyi-modules-system.jar /home/ruoyi/ruoyi-modules-system.jar
COPY ./jar/tongran-modules-system.jar /home/tongran/tongran-modules-system.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","ruoyi-modules-system.jar"]
ENTRYPOINT ["java","-jar","tongran-modules-system.jar"]
+6 -6
View File
@@ -1,15 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
MAINTAINER tongran
# 挂载目录
VOLUME /home/ruoyi
VOLUME /home/tongran
# 创建目录
RUN mkdir -p /home/ruoyi
RUN mkdir -p /home/tongran
# 指定路径
WORKDIR /home/ruoyi
WORKDIR /home/tongran
# 复制jar文件到路径
COPY ./jar/ruoyi-visual-monitor.jar /home/ruoyi/ruoyi-visual-monitor.jar
COPY ./jar/tongran-visual-monitor.jar /home/tongran/tongran-visual-monitor.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","ruoyi-visual-monitor.jar"]
ENTRYPOINT ["java","-jar","tongran-visual-monitor.jar"]
+42 -43
View File
@@ -4,16 +4,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<groupId>com.tongran</groupId>
<artifactId>tongran</artifactId>
<version>3.6.6</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依微服务系统</description>
<name>tongran</name>
<description>彤然微服务系统</description>
<properties>
<ruoyi.version>3.6.6</ruoyi.version>
<tongran.version>3.6.6</tongran.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
@@ -184,85 +183,85 @@
<!-- 核心模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-core</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-core</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 接口模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-swagger</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-swagger</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 安全模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-security</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-security</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 数据脱敏 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-sensitive</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-sensitive</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 权限范围 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datascope</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-datascope</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 多数据源 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datasource</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-datasource</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 分布式事务 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-seata</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-seata</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 日志记录 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-log</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-log</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 缓存服务 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-redis</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-redis</artifactId>
<version>${tongran.version}</version>
</dependency>
<!-- 系统接口 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-api-system</artifactId>
<version>${ruoyi.version}</version>
<groupId>com.tongran</groupId>
<artifactId>tongran-api-system</artifactId>
<version>${tongran.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-auth</module>
<module>ruoyi-gateway</module>
<module>ruoyi-visual</module>
<module>ruoyi-modules</module>
<module>ruoyi-rocketmq</module>
<module>ruoyi-api</module>
<module>ruoyi-common</module>
<module>tongran-auth</module>
<module>tongran-gateway</module>
<module>tongran-visual</module>
<module>tongran-modules</module>
<module>tongran-rocketmq</module>
<module>tongran-api</module>
<module>tongran-common</module>
</modules>
<packaging>pom</packaging>
@@ -1,5 +0,0 @@
com.ruoyi.system.api.factory.RemoteUserFallbackFactory
com.ruoyi.system.api.factory.RemoteLogFallbackFactory
com.ruoyi.system.api.factory.RemoteFileFallbackFactory
com.ruoyi.system.api.factory.RemoteRevenueConfigFallbackFactory
com.ruoyi.system.api.factory.RemoteRocketMqFallbackFactory
-30
View File
@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.6.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>ruoyi-common-log</module>
<module>ruoyi-common-core</module>
<module>ruoyi-common-redis</module>
<module>ruoyi-common-seata</module>
<module>ruoyi-common-swagger</module>
<module>ruoyi-common-security</module>
<module>ruoyi-common-sensitive</module>
<module>ruoyi-common-datascope</module>
<module>ruoyi-common-datasource</module>
</modules>
<artifactId>ruoyi-common</artifactId>
<packaging>pom</packaging>
<description>
ruoyi-common通用模块
</description>
</project>
@@ -1,29 +0,0 @@
package com.ruoyi.common.core.constant;
/**
* 服务名称
*
* @author ruoyi
*/
public class ServiceNameConstants
{
/**
* 认证服务的serviceid
*/
public static final String AUTH_SERVICE = "ruoyi-auth";
/**
* 系统模块的serviceid
*/
public static final String SYSTEM_SERVICE = "ruoyi-system";
/**
* 文件服务的serviceid
*/
public static final String FILE_SERVICE = "ruoyi-file";
/**
* rocketMq的serviceid
*/
public static final String ROCKETMQ_SERVICE = "ruoyi-rocketmq";
}
@@ -1 +0,0 @@
com.ruoyi.common.datascope.aspect.DataScopeAspect
@@ -1,2 +0,0 @@
com.ruoyi.common.log.service.AsyncLogService
com.ruoyi.common.log.aspect.LogAspect
@@ -1,2 +0,0 @@
com.ruoyi.common.redis.configure.RedisConfig
com.ruoyi.common.redis.service.RedisService
@@ -1,89 +0,0 @@
package com.ruoyi.common.security.aspect;
import java.lang.reflect.Method;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import com.ruoyi.common.security.annotation.RequiresLogin;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.common.security.annotation.RequiresRoles;
import com.ruoyi.common.security.auth.AuthUtil;
/**
* 基于 Spring Aop 的注解鉴权
*
* @author kong
*/
@Aspect
@Component
public class PreAuthorizeAspect
{
/**
* 构建
*/
public PreAuthorizeAspect()
{
}
/**
* 定义AOP签名 (切入所有使用鉴权注解的方法)
*/
public static final String POINTCUT_SIGN = " @annotation(com.ruoyi.common.security.annotation.RequiresLogin) || "
+ "@annotation(com.ruoyi.common.security.annotation.RequiresPermissions) || "
+ "@annotation(com.ruoyi.common.security.annotation.RequiresRoles)";
/**
* 声明AOP签名
*/
@Pointcut(POINTCUT_SIGN)
public void pointcut()
{
}
/**
* 环绕切入
*
* @param joinPoint 切面对象
* @return 底层方法执行后的返回值
* @throws Throwable 底层方法抛出的异常
*/
@Around("pointcut()")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable
{
// 注解鉴权
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
checkMethodAnnotation(signature.getMethod());
// 执行原有逻辑
return joinPoint.proceed();
}
/**
* 对一个Method对象进行注解检查
*/
public void checkMethodAnnotation(Method method)
{
// 校验 @RequiresLogin 注解
RequiresLogin requiresLogin = method.getAnnotation(RequiresLogin.class);
if (requiresLogin != null)
{
AuthUtil.checkLogin();
}
// 校验 @RequiresRoles 注解
RequiresRoles requiresRoles = method.getAnnotation(RequiresRoles.class);
if (requiresRoles != null)
{
AuthUtil.checkRole(requiresRoles);
}
// 校验 @RequiresPermissions 注解
RequiresPermissions requiresPermissions = method.getAnnotation(RequiresPermissions.class);
if (requiresPermissions != null)
{
AuthUtil.checkPermi(requiresPermissions);
}
}
}
@@ -1,5 +0,0 @@
com.ruoyi.common.security.config.WebMvcConfig
com.ruoyi.common.security.service.TokenService
com.ruoyi.common.security.aspect.PreAuthorizeAspect
com.ruoyi.common.security.aspect.InnerAuthAspect
com.ruoyi.common.security.handler.GlobalExceptionHandler
@@ -1 +0,0 @@
com.ruoyi.common.swagger.config.SpringDocAutoConfiguration
@@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/ruoyi-job" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>
@@ -1,25 +0,0 @@
package com.ruoyi.mtragent;
import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* 平台管理模块
*
* @author ruoyi
*/
@EnableCustomConfig
@EnableRyFeignClients
@SpringBootApplication
@EnableAsync
public class RuoYiMtragentApplication
{
public static void main(String[] args)
{
SpringApplication.run(RuoYiMtragentApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ RuoYiMtragent模块启动成功 ლ(´ڡ`ლ)゙");
}
}
@@ -1,86 +0,0 @@
package com.ruoyi.mtragent.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* mtr探测丢包clinetId记录对象 all_mtr_client
*
* @author gyt
* @date 2025-11-24
*/
public class AllMtrClient extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** MTR客户端ID */
@Excel(name = "MTR客户端ID")
private String mtrClientId;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
/** 公网IP地址 */
@Excel(name = "公网IP地址")
private String publicIp;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setMtrClientId(String mtrClientId)
{
this.mtrClientId = mtrClientId;
}
public String getMtrClientId()
{
return mtrClientId;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
public void setPublicIp(String publicIp)
{
this.publicIp = publicIp;
}
public String getPublicIp()
{
return publicIp;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("mtrClientId", getMtrClientId())
.append("clientId", getClientId())
.append("publicIp", getPublicIp())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}
@@ -1,65 +0,0 @@
package com.ruoyi.mtragent.mapper;
import com.ruoyi.mtragent.domain.RmNetworkInterface;
import java.util.List;
/**
* 客户端网络接口信息Mapper接口
*
* @author gyt
* @date 2025-10-14
*/
public interface RmNetworkInterfaceMapper
{
/**
* 查询客户端网络接口信息
*
* @param id 客户端网络接口信息主键
* @return 客户端网络接口信息
*/
public RmNetworkInterface selectRmNetworkInterfaceById(Long id);
/**
* 查询客户端网络接口信息列表
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 客户端网络接口信息集合
*/
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface);
/**
* 新增客户端网络接口信息
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 结果
*/
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
/**
* 修改客户端网络接口信息
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 结果
*/
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
/**
* 删除客户端网络接口信息
*
* @param id 客户端网络接口信息主键
* @return 结果
*/
public int deleteRmNetworkInterfaceById(Long id);
/**
* 批量删除客户端网络接口信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRmNetworkInterfaceByIds(Long[] ids);
int updateRmNetworkInterfaceByMac(RmNetworkInterface rmNetworkInterface);
}
@@ -1,182 +0,0 @@
package com.ruoyi.mtragent.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.enums.MsgEnum;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.mtragent.domain.DeviceMessage;
import com.ruoyi.mtragent.domain.RmNetworkInterface;
import com.ruoyi.mtragent.domain.vo.PolicyTypeVo;
import com.ruoyi.mtragent.mapper.RmNetworkInterfaceMapper;
import com.ruoyi.mtragent.model.ProducerMode;
import com.ruoyi.mtragent.producer.MessageProducer;
import com.ruoyi.mtragent.service.IRmNetworkInterfaceService;
import com.ruoyi.system.api.domain.RouteMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 客户端网络接口信息Service业务层处理
*
* @author gyt
* @date 2025-10-14
*/
@Service
public class RmNetworkInterfaceServiceImpl implements IRmNetworkInterfaceService
{
@Autowired
private RmNetworkInterfaceMapper rmNetworkInterfaceMapper;
@Autowired
private ProducerMode producerMode;
/**
* 查询客户端网络接口信息
*
* @param id 客户端网络接口信息主键
* @return 客户端网络接口信息
*/
@Override
public RmNetworkInterface selectRmNetworkInterfaceById(Long id)
{
return rmNetworkInterfaceMapper.selectRmNetworkInterfaceById(id);
}
/**
* 查询客户端网络接口信息列表
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 客户端网络接口信息
*/
@Override
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface)
{
return rmNetworkInterfaceMapper.selectRmNetworkInterfaceList(rmNetworkInterface);
}
/**
* 新增客户端网络接口信息
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 结果
*/
@Override
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface)
{
rmNetworkInterface.setCreateTime(DateUtils.getNowDate());
return rmNetworkInterfaceMapper.insertRmNetworkInterface(rmNetworkInterface);
}
/**
* 修改客户端网络接口信息
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 结果
*/
@Override
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface)
{
rmNetworkInterface.setUpdateTime(DateUtils.getNowDate());
return rmNetworkInterfaceMapper.updateRmNetworkInterface(rmNetworkInterface);
}
@Override
public int updateRmNetworkInterfaceByMac(RmNetworkInterface rmNetworkInterface) {
rmNetworkInterface.setUpdateTime(DateUtils.getNowDate());
return rmNetworkInterfaceMapper.updateRmNetworkInterfaceByMac(rmNetworkInterface);
}
/**
* 批量删除客户端网络接口信息
*
* @param ids 需要删除的客户端网络接口信息主键
* @return 结果
*/
@Override
public int deleteRmNetworkInterfaceByIds(Long[] ids)
{
return rmNetworkInterfaceMapper.deleteRmNetworkInterfaceByIds(ids);
}
/**
* 删除客户端网络接口信息信息
*
* @param id 客户端网络接口信息主键
* @return 结果
*/
@Override
public int deleteRmNetworkInterfaceById(Long id)
{
return rmNetworkInterfaceMapper.deleteRmNetworkInterfaceById(id);
}
/**
* 绑定公网ip
* @param rmNetworkInterface
* @return
*/
@Override
public int bindPublicIp(RmNetworkInterface rmNetworkInterface) {
return rmNetworkInterfaceMapper.updateRmNetworkInterface(rmNetworkInterface);
}
/**
* 更新路由信息
* @param clientId
*/
public void updateRouteMsg(String clientId){
MessageProducer messageProducer = new MessageProducer();
// 查询路由是否有变化
RmNetworkInterface rmNetworkInterface = new RmNetworkInterface();
rmNetworkInterface.setClientId(clientId);
rmNetworkInterface.setBindIp("2");
List<RmNetworkInterface> networkInterfaces = rmNetworkInterfaceMapper.selectRmNetworkInterfaceList(rmNetworkInterface);
if(!networkInterfaces.isEmpty()){
List<RmNetworkInterface> oldList = networkInterfaces.stream()
.filter(networkInterface -> networkInterface.getNewFlag() == 0)
.collect(Collectors.toList());
if(!oldList.isEmpty()){
Map<String, Object> resultMap = new HashMap<>();
// 增加静态路由
RmNetworkInterface oldMsg = oldList.get(0);
RouteMsg oldRouteMsg = new RouteMsg();
oldRouteMsg.setGateway(oldMsg.getGateway());
oldRouteMsg.setName(oldMsg.getInterfaceName());
resultMap.put("delRoute", oldRouteMsg);
List<RmNetworkInterface> newList = networkInterfaces.stream()
.filter(networkInterface -> networkInterface.getNewFlag() == 1)
.collect(Collectors.toList());
RmNetworkInterface newMsg = newList.get(0);
RouteMsg newRouteMsg = new RouteMsg();
newRouteMsg.setGateway(newMsg.getGateway());
newRouteMsg.setName(newMsg.getInterfaceName());
resultMap.put("addRoute", newRouteMsg);
resultMap.put("upTime", Instant.now().getEpochSecond());
PolicyTypeVo policyTypeVo = new PolicyTypeVo();
policyTypeVo.setRoutes(JSONObject.toJSONString(resultMap));
String configJson = JSONObject.toJSONString(policyTypeVo);
// 构建发送消息
DeviceMessage message = new DeviceMessage();
message.setClientId(clientId);
message.setData(configJson);
message.setDataType(MsgEnum.获取最新策略应答.getValue());
messageProducer.sendAsyncProducerMessage(
producerMode.getAgentTopic(),
"",
"",
JSONObject.toJSONString(message)
);
// 更新网卡信息表
RmNetworkInterface updateQuery = new RmNetworkInterface();
updateQuery.setNewFlag(999);
updateQuery.setMacAddress(networkInterfaces.get(0).getMacAddress());
rmNetworkInterfaceMapper.updateRmNetworkInterfaceByMac(updateQuery);
}
}
}
}
@@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/ruoyi-system" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>
@@ -1,420 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.RmResourceRegistrationMapper">
<resultMap type="RmResourceRegistration" id="RmResourceRegistrationResult">
<result property="id" column="id" />
<result property="hardwareSn" column="hardware_sn" />
<result property="resourceType" column="resource_type" />
<result property="resourceName" column="resource_name" />
<result property="ipAddress" column="ip_address" />
<result property="resourcePort" column="resource_port" />
<result property="otherPortName" column="other_port_name" />
<result property="agentVersion" column="agent_version" />
<result property="protocol" column="protocol" />
<result property="resourceVersion" column="resource_version" />
<result property="rwPermission" column="rw_permission" />
<result property="snmpDetect" column="snmp_detect" />
<result property="teamName" column="team_name" />
<result property="snmpCollectAddr" column="snmp_collect_addr" />
<result property="snmpCollectPort" column="snmp_collect_port" />
<result property="securityLevel" column="security_level" />
<result property="encryption" column="encryption" />
<result property="resourceUserName" column="resource_user_name" />
<result property="resourcePwd" column="resource_pwd" />
<result property="registrationStatus" column="registration_status" />
<result property="onlineStatus" column="online_status" />
<result property="switchOnlineStatus" column="switch_online_status" />
<result property="description" column="description" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="serviceNumber" column="service_number" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="creatorId" column="creator_id" />
<result property="creatorName" column="creator_name" />
<result property="updaterId" column="updater_id" />
<result property="updaterName" column="updater_name" />
<result property="clientId" column="client_id" />
<result property="operator" column="operator" />
<result property="province" column="province" />
<result property="publicIp" column="public_ip" />
<result property="businessName" column="business_name" />
<result property="logicalNodeId" column="logical_node_id" />
<result property="multiPublicIpStatus" column="multi_public_ip_status" />
<result property="heartbeatCount" column="heartbeat_count" />
<result property="heartbeatInterval" column="heartbeat_interval" />
<result property="onboardTime" column="onboard_time" />
</resultMap>
<sql id="selectRmResourceRegistrationVo">
select id, hardware_sn, resource_type, resource_name, ip_address, resource_port, other_port_name,
agent_version, protocol, resource_version, rw_permission, snmp_detect, team_name, snmp_collect_addr,
snmp_collect_port, security_level, encryption, resource_user_name, resource_pwd, registration_status,
online_status, switch_online_status, description, customer_id, customer_name, service_number,
create_time, update_time, creator_id, creator_name, updater_id, updater_name, client_id, operator,
province, public_ip, business_name, logical_node_id, multi_public_ip_status, heartbeat_count,
heartbeat_interval, onboard_time from rm_resource_registration
</sql>
<select id="selectRmResourceRegistrationList" parameterType="RmResourceRegistration" resultMap="RmResourceRegistrationResult">
<include refid="selectRmResourceRegistrationVo"/>
<where>
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
<if test="resourcePort != null and resourcePort != ''"> and resource_port = #{resourcePort}</if>
<if test="otherPortName != null and otherPortName != ''"> and other_port_name like concat('%', #{otherPortName}, '%')</if>
<if test="agentVersion != null and agentVersion != ''"> and agent_version = #{agentVersion}</if>
<if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
<if test="resourceVersion != null and resourceVersion != ''"> and resource_version = #{resourceVersion}</if>
<if test="rwPermission != null and rwPermission != ''"> and rw_permission = #{rwPermission}</if>
<if test="snmpDetect != null and snmpDetect != ''"> and snmp_detect = #{snmpDetect}</if>
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
<if test="snmpCollectAddr != null and snmpCollectAddr != ''"> and snmp_collect_addr = #{snmpCollectAddr}</if>
<if test="snmpCollectPort != null "> and snmp_collect_port = #{snmpCollectPort}</if>
<if test="securityLevel != null and securityLevel != ''"> and security_level = #{securityLevel}</if>
<if test="encryption != null and encryption != ''"> and encryption = #{encryption}</if>
<if test="resourceUserName != null and resourceUserName != ''"> and resource_user_name like concat('%', #{resourceUserName}, '%')</if>
<if test="resourcePwd != null and resourcePwd != ''"> and resource_pwd = #{resourcePwd}</if>
<if test="registrationStatus != null and registrationStatus != ''"> and registration_status = #{registrationStatus}</if>
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
<if test="switchOnlineStatus != null and switchOnlineStatus != ''"> and switch_online_status = #{switchOnlineStatus}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="customerId != null "> and customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="serviceNumber != null and serviceNumber != ''"> and service_number = #{serviceNumber}</if>
<if test="creatorId != null "> and creator_id = #{creatorId}</if>
<if test="creatorName != null and creatorName != ''"> and creator_name like concat('%', #{creatorName}, '%')</if>
<if test="updaterId != null "> and updater_id = #{updaterId}</if>
<if test="updaterName != null and updaterName != ''"> and updater_name like concat('%', #{updaterName}, '%')</if>
<if test="queryName != null and queryName != ''"> and (hardware_sn = #{queryName} or resource_name like concat('%', #{queryName}, '%')) </if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="operator != null and operator != ''"> and operator = #{operator}</if>
<if test="province != null and province != ''"> and province = #{province}</if>
<if test="publicIp != null and publicIp != ''"> and public_ip = #{publicIp}</if>
<if test="businessName != null and businessName != ''"> and business_name like concat('%', #{businessName}, '%')</if>
<if test="logicalNodeId != null and logicalNodeId != ''"> and logical_node_id = #{logicalNodeId}</if>
<if test="multiPublicIpStatus != null and multiPublicIpStatus != ''"> and multi_public_ip_status = #{multiPublicIpStatus}</if>
</where>
order by create_time desc
</select>
<select id="selectRmResourceRegistrationById" parameterType="Long" resultMap="RmResourceRegistrationResult">
<include refid="selectRmResourceRegistrationVo"/>
where id = #{id}
</select>
<insert id="insertRmResourceRegistration" parameterType="RmResourceRegistration" useGeneratedKeys="true" keyProperty="id">
insert into rm_resource_registration
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="hardwareSn != null">hardware_sn,</if>
<if test="resourceType != null">resource_type,</if>
<if test="resourceName != null">resource_name,</if>
<if test="ipAddress != null">ip_address,</if>
<if test="resourcePort != null">resource_port,</if>
<if test="otherPortName != null">other_port_name,</if>
<if test="agentVersion != null">agent_version,</if>
<if test="protocol != null">protocol,</if>
<if test="resourceVersion != null">resource_version,</if>
<if test="rwPermission != null">rw_permission,</if>
<if test="snmpDetect != null">snmp_detect,</if>
<if test="teamName != null">team_name,</if>
<if test="snmpCollectAddr != null">snmp_collect_addr,</if>
<if test="snmpCollectPort != null">snmp_collect_port,</if>
<if test="securityLevel != null">security_level,</if>
<if test="encryption != null">encryption,</if>
<if test="resourceUserName != null">resource_user_name,</if>
<if test="resourcePwd != null">resource_pwd,</if>
<if test="registrationStatus != null">registration_status,</if>
<if test="onlineStatus != null">online_status,</if>
<if test="switchOnlineStatus != null">switch_online_status,</if>
<if test="description != null">description,</if>
<if test="customerId != null">customer_id,</if>
<if test="customerName != null">customer_name,</if>
<if test="serviceNumber != null">service_number,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="creatorId != null">creator_id,</if>
<if test="creatorName != null">creator_name,</if>
<if test="updaterId != null">updater_id,</if>
<if test="updaterName != null">updater_name,</if>
<if test="clientId != null">client_id,</if>
<if test="operator != null">operator,</if>
<if test="province != null">province,</if>
<if test="publicIp != null">public_ip,</if>
<if test="businessName != null">business_name,</if>
<if test="logicalNodeId != null">logical_node_id,</if>
<if test="multiPublicIpStatus != null">multi_public_ip_status,</if>
<if test="heartbeatCount != null">heartbeat_count,</if>
<if test="heartbeatInterval != null">heartbeat_interval,</if>
<if test="onboardTime != null">onboard_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="hardwareSn != null">#{hardwareSn},</if>
<if test="resourceType != null">#{resourceType},</if>
<if test="resourceName != null">#{resourceName},</if>
<if test="ipAddress != null">#{ipAddress},</if>
<if test="resourcePort != null">#{resourcePort},</if>
<if test="otherPortName != null">#{otherPortName},</if>
<if test="agentVersion != null">#{agentVersion},</if>
<if test="protocol != null">#{protocol},</if>
<if test="resourceVersion != null">#{resourceVersion},</if>
<if test="rwPermission != null">#{rwPermission},</if>
<if test="snmpDetect != null">#{snmpDetect},</if>
<if test="teamName != null">#{teamName},</if>
<if test="snmpCollectAddr != null">#{snmpCollectAddr},</if>
<if test="snmpCollectPort != null">#{snmpCollectPort},</if>
<if test="securityLevel != null">#{securityLevel},</if>
<if test="encryption != null">#{encryption},</if>
<if test="resourceUserName != null">#{resourceUserName},</if>
<if test="resourcePwd != null">#{resourcePwd},</if>
<if test="registrationStatus != null">#{registrationStatus},</if>
<if test="onlineStatus != null">#{onlineStatus},</if>
<if test="switchOnlineStatus != null">#{switchOnlineStatus},</if>
<if test="description != null">#{description},</if>
<if test="customerId != null">#{customerId},</if>
<if test="customerName != null">#{customerName},</if>
<if test="serviceNumber != null">#{serviceNumber},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="creatorId != null">#{creatorId},</if>
<if test="creatorName != null">#{creatorName},</if>
<if test="updaterId != null">#{updaterId},</if>
<if test="updaterName != null">#{updaterName},</if>
<if test="clientId != null">#{clientId},</if>
<if test="operator != null">#{operator},</if>
<if test="province != null">#{province},</if>
<if test="publicIp != null">#{publicIp},</if>
<if test="businessName != null">#{businessName},</if>
<if test="logicalNodeId != null">#{logicalNodeId},</if>
<if test="multiPublicIpStatus != null">#{multiPublicIpStatus},</if>
<if test="heartbeatCount != null">#{heartbeatCount},</if>
<if test="heartbeatInterval != null">#{heartbeatInterval},</if>
<if test="onboardTime != null">#{onboardTime},</if>
</trim>
</insert>
<update id="updateRmResourceRegistration" parameterType="RmResourceRegistration">
update rm_resource_registration
<trim prefix="SET" suffixOverrides=",">
<if test="hardwareSn != null">hardware_sn = #{hardwareSn},</if>
<if test="resourceType != null">resource_type = #{resourceType},</if>
<if test="resourceName != null">resource_name = #{resourceName},</if>
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
<if test="resourcePort != null">resource_port = #{resourcePort},</if>
<if test="otherPortName != null">other_port_name = #{otherPortName},</if>
<if test="agentVersion != null">agent_version = #{agentVersion},</if>
<if test="protocol != null">protocol = #{protocol},</if>
<if test="resourceVersion != null">resource_version = #{resourceVersion},</if>
<if test="rwPermission != null">rw_permission = #{rwPermission},</if>
<if test="snmpDetect != null">snmp_detect = #{snmpDetect},</if>
<if test="teamName != null">team_name = #{teamName},</if>
<if test="snmpCollectAddr != null">snmp_collect_addr = #{snmpCollectAddr},</if>
<if test="snmpCollectPort != null">snmp_collect_port = #{snmpCollectPort},</if>
<if test="securityLevel != null">security_level = #{securityLevel},</if>
<if test="encryption != null">encryption = #{encryption},</if>
<if test="resourceUserName != null">resource_user_name = #{resourceUserName},</if>
<if test="resourcePwd != null">resource_pwd = #{resourcePwd},</if>
<if test="registrationStatus != null">registration_status = #{registrationStatus},</if>
<if test="onlineStatus != null">online_status = #{onlineStatus},</if>
<if test="switchOnlineStatus != null">switch_online_status = #{switchOnlineStatus},</if>
<if test="description != null">description = #{description},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="serviceNumber != null">service_number = #{serviceNumber},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="creatorName != null">creator_name = #{creatorName},</if>
<if test="updaterId != null">updater_id = #{updaterId},</if>
<if test="updaterName != null">updater_name = #{updaterName},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="operator != null">operator = #{operator},</if>
<if test="province != null">province = #{province},</if>
<if test="publicIp != null">public_ip = #{publicIp},</if>
<if test="businessName != null">business_name = #{businessName},</if>
<if test="logicalNodeId != null">logical_node_id = #{logicalNodeId},</if>
<if test="multiPublicIpStatus != null">multi_public_ip_status = #{multiPublicIpStatus},</if>
<if test="heartbeatCount != null">heartbeat_count = #{heartbeatCount},</if>
<if test="heartbeatInterval != null">heartbeat_interval = #{heartbeatInterval},</if>
<if test="onboardTime != null">onboard_time = #{onboardTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRmResourceRegistrationById" parameterType="Long">
delete from rm_resource_registration where id = #{id}
</delete>
<delete id="deleteRmResourceRegistrationByIds" parameterType="String">
delete from rm_resource_registration where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 查询所有资源名称(包含设备使用)-->
<select id="selectAllResourceName" resultType="java.util.Map">
select id id,resource_name resourceName from rm_resource_registration
<where>
and registration_status = 1
</where>
group by id
</select>
<!-- 查询所有资源名称-->
<select id="selectAllResourceNameByType" parameterType="RmResourceRegistration" resultType="java.util.Map">
SELECT
resource_name AS resourceName,
CASE
WHEN resource_type = '1' THEN ip_address
WHEN resource_type = '2' THEN snmp_collect_addr
END AS ipAddress,
hardware_sn AS hardwareSn
FROM rm_resource_registration
<where>
and registration_status = 1
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
<if test="resourcePort != null and resourcePort != ''"> and resource_port = #{resourcePort}</if>
<if test="otherPortName != null and otherPortName != ''"> and other_port_name = #{otherPortName}</if>
<if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
<if test="resourceVersion != null and resourceVersion != ''"> and resource_version = #{resourceVersion}</if>
<if test="rwPermission != null and rwPermission != ''"> and rw_permission = #{rwPermission}</if>
<if test="securityLevel != null and securityLevel != ''"> and security_level = #{securityLevel}</if>
<if test="encryption != null and encryption != ''"> and encryption = #{encryption}</if>
<if test="resourceUserName != null and resourceUserName != ''"> and resource_user_name = #{resourceUserName}</if>
<if test="resourcePwd != null and resourcePwd != ''"> and resource_pwd = #{resourcePwd}</if>
<if test="registrationStatus != null and registrationStatus != ''"> and registration_status = #{registrationStatus}</if>
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="customerId != null "> and customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="serviceNumber != null and serviceNumber != ''"> and service_number = #{serviceNumber}</if>
<if test="creatorId != null "> and creator_id = #{creatorId}</if>
<if test="creatorName != null and creatorName != ''"> and creator_name like concat('%', #{creatorName}, '%')</if>
<if test="updaterId != null "> and updater_id = #{updaterId}</if>
<if test="updaterName != null and updaterName != ''"> and updater_name like concat('%', #{updaterName}, '%')</if>
</where>
group by resource_name
</select>
<select id="countBySn" parameterType="String">
select count(1) from rm_resource_registration
where hardware_sn = #{hardwareSn}
</select>
<update id="updateStatusByResource" parameterType="RmResourceRegistration">
update rm_resource_registration
<trim prefix="SET" suffixOverrides=",">
<if test="resourceType != null">resource_type = #{resourceType},</if>
<if test="resourceName != null">resource_name = #{resourceName},</if>
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
<if test="resourcePort != null">resource_port = #{resourcePort},</if>
<if test="otherPortName != null">other_port_name = #{otherPortName},</if>
<if test="agentVersion != null">agent_version = #{agentVersion},</if>
<if test="protocol != null">protocol = #{protocol},</if>
<if test="resourceVersion != null">resource_version = #{resourceVersion},</if>
<if test="rwPermission != null">rw_permission = #{rwPermission},</if>
<if test="snmpDetect != null">snmp_detect = #{snmpDetect},</if>
<if test="teamName != null">team_name = #{teamName},</if>
<if test="snmpCollectAddr != null">snmp_collect_addr = #{snmpCollectAddr},</if>
<if test="snmpCollectPort != null">snmp_collect_port = #{snmpCollectPort},</if>
<if test="securityLevel != null">security_level = #{securityLevel},</if>
<if test="encryption != null">encryption = #{encryption},</if>
<if test="resourceUserName != null">resource_user_name = #{resourceUserName},</if>
<if test="resourcePwd != null">resource_pwd = #{resourcePwd},</if>
<if test="registrationStatus != null">registration_status = #{registrationStatus},</if>
<if test="onlineStatus != null">online_status = #{onlineStatus},</if>
<if test="switchOnlineStatus != null">switch_online_status = #{switchOnlineStatus},</if>
<if test="description != null">description = #{description},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="serviceNumber != null">service_number = #{serviceNumber},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="creatorName != null">creator_name = #{creatorName},</if>
<if test="updaterId != null">updater_id = #{updaterId},</if>
<if test="updaterName != null">updater_name = #{updaterName},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="operator != null">operator = #{operator},</if>
<if test="province != null">province = #{province},</if>
<if test="publicIp != null">public_ip = #{publicIp},</if>
<if test="businessName != null">business_name = #{businessName},</if>
<if test="logicalNodeId != null">logical_node_id = #{logicalNodeId},</if>
<if test="multiPublicIpStatus != null">multi_public_ip_status = #{multiPublicIpStatus},</if>
<if test="heartbeatCount != null">heartbeat_count = #{heartbeatCount},</if>
<if test="heartbeatInterval != null">heartbeat_interval = #{heartbeatInterval},</if>
<if test="onboardTime != null">onboard_time = #{onboardTime},</if>
</trim>
<where>
<choose>
<when test="hardwareSn != null">
and hardware_sn = #{hardwareSn}
</when>
<when test="clientId != null">
and client_id = #{clientId}
</when>
<otherwise>
and 1=0 <!-- 如果两个条件都不满足,则不更新任何记录 -->
</otherwise>
</choose>
</where>
</update>
<select id="getRegistrationByIds" parameterType="String" resultMap="RmResourceRegistrationResult">
<include refid="selectRmResourceRegistrationVo"/>
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectRegistMsgByClientId" parameterType="RmResourceRegistration" resultMap="RmResourceRegistrationResult">
<include refid="selectRmResourceRegistrationVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
order by create_time desc
</select>
<select id="getAllLogicalNodeId" parameterType="RmResourceRegistration" resultType="java.util.Map">
select logical_node_id logicalNodeId from rm_resource_registration where logical_node_id != ''
group by logical_node_id
</select>
<select id="getRegistrationTableInfoList" parameterType="RmResourceRegistration" resultType="RmResourceRegistration">
select
a.id,
a.hardware_sn as hardwareSn,
a.agent_version as agentVersion,
a.registration_status as registrationStatus,
a.online_status as onlineStatus,
a.create_time as createTime,
a.update_time as updateTime,
a.client_id as clientId,
a.business_name as businessName,
a.logical_node_id as logicalNodeId,
a.multi_public_ip_status as multiPublicIpStatus,
a.heartbeat_count as heartbeatCount,
a.heartbeat_interval as heartbeatInterval,
a.onboard_time as onboardTime,
b.machine_code as machineCode
from rm_resource_registration a
left join rm_registration_machine b on a.client_id = b.client_id
<where>
<if test="hardwareSn != null and hardwareSn != ''"> and a.hardware_sn = #{hardwareSn}</if>
<if test="resourceType != null and resourceType != ''"> and a.resource_type = #{resourceType}</if>
<if test="agentVersion != null and agentVersion != ''"> and a.agent_version = #{agentVersion}</if>
<if test="registrationStatus != null and registrationStatus != ''"> and a.registration_status = #{registrationStatus}</if>
<if test="onlineStatus != null and onlineStatus != ''"> and a.online_status = #{onlineStatus}</if>
<if test="clientId != null and clientId != ''"> and a.client_id = #{clientId}</if>
<if test="businessName != null and businessName != ''"> and a.business_name like concat('%', #{businessName}, '%')</if>
<if test="logicalNodeId != null and logicalNodeId != ''"> and a.logical_node_id = #{logicalNodeId}</if>
<if test="multiPublicIpStatus != null and multiPublicIpStatus != ''"> and a.multi_public_ip_status = #{multiPublicIpStatus}</if>
<if test="businessEmpty"> and a.business_name is null</if>
<if test="logicalNodeEmpty"> and a.logical_node_id is null</if>
</where>
order by a.create_time desc
</select>
</mapper>
@@ -1,252 +0,0 @@
package com.ruoyi.rocketmq.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 初始带宽流量临时表对象 initial_bandwidth_traffic_temp
*
* @author gyt
* @date 2025-11-05
*/
public class InitialBandwidthTrafficTemp extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 唯一标识ID */
private Long id;
/** 接口名称 */
@Excel(name = "接口名称")
private String name;
/** MAC地址 */
@Excel(name = "MAC地址")
private String mac;
/** 运行状态 */
@Excel(name = "运行状态")
private String status;
/** 接口类型 */
@Excel(name = "接口类型")
private String type;
/** IPv4地址 */
@Excel(name = "IPv4地址")
private String ipV4;
/** 入站丢包率(%) */
@Excel(name = "入站丢包率(%)")
private BigDecimal inDropped;
/** 出站丢包率(%) */
@Excel(name = "出站丢包率(%)")
private BigDecimal outDropped;
/** 接收带宽(big) */
@Excel(name = "接收带宽(big)")
private String inSpeed;
/** 发送带宽(bit) */
@Excel(name = "发送带宽(bit)")
private String outSpeed;
/** 协商速度 */
@Excel(name = "协商速度")
private String speed;
/** 工作模式 */
@Excel(name = "工作模式")
private String duplex;
/** 设备唯一标识 */
@Excel(name = "设备唯一标识")
private String clientId;
/** 总接收带宽(bit) */
@Excel(name = "总接收带宽(bit)")
private String totalInSpeed;
/** 总发送带宽(bit) */
@Excel(name = "总发送带宽(bit)")
private String totalOutSpeed;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setMac(String mac)
{
this.mac = mac;
}
public String getMac()
{
return mac;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setIpV4(String ipV4)
{
this.ipV4 = ipV4;
}
public String getIpV4()
{
return ipV4;
}
public void setInDropped(BigDecimal inDropped)
{
this.inDropped = inDropped;
}
public BigDecimal getInDropped()
{
return inDropped;
}
public void setOutDropped(BigDecimal outDropped)
{
this.outDropped = outDropped;
}
public BigDecimal getOutDropped()
{
return outDropped;
}
public void setInSpeed(String inSpeed)
{
this.inSpeed = inSpeed;
}
public String getInSpeed()
{
return inSpeed;
}
public void setOutSpeed(String outSpeed)
{
this.outSpeed = outSpeed;
}
public String getOutSpeed()
{
return outSpeed;
}
public void setSpeed(String speed)
{
this.speed = speed;
}
public String getSpeed()
{
return speed;
}
public void setDuplex(String duplex)
{
this.duplex = duplex;
}
public String getDuplex()
{
return duplex;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
public void setTotalInSpeed(String totalInSpeed)
{
this.totalInSpeed = totalInSpeed;
}
public String getTotalInSpeed()
{
return totalInSpeed;
}
public void setTotalOutSpeed(String totalOutSpeed)
{
this.totalOutSpeed = totalOutSpeed;
}
public String getTotalOutSpeed()
{
return totalOutSpeed;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("mac", getMac())
.append("status", getStatus())
.append("type", getType())
.append("ipV4", getIpV4())
.append("inDropped", getInDropped())
.append("outDropped", getOutDropped())
.append("inSpeed", getInSpeed())
.append("outSpeed", getOutSpeed())
.append("speed", getSpeed())
.append("duplex", getDuplex())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("clientId", getClientId())
.append("totalInSpeed", getTotalInSpeed())
.append("totalOutSpeed", getTotalOutSpeed())
.toString();
}
}
@@ -1,82 +0,0 @@
package com.ruoyi.rocketmq.service;
import com.ruoyi.rocketmq.domain.RmNetworkInterface;
import java.util.List;
/**
* 客户端网络接口信息Service接口
*
* @author gyt
* @date 2025-10-14
*/
public interface IRmNetworkInterfaceService
{
/**
* 查询客户端网络接口信息
*
* @param id 客户端网络接口信息主键
* @return 客户端网络接口信息
*/
public RmNetworkInterface selectRmNetworkInterfaceById(Long id);
/**
* 查询客户端网络接口信息列表
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 客户端网络接口信息集合
*/
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface);
/**
* 新增客户端网络接口信息
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 结果
*/
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
/**
* 修改客户端网络接口信息
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 结果
*/
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
/**
* 修改客户端网络接口信息
*
* @param rmNetworkInterface 客户端网络接口信息
* @return 结果
*/
public int updateRmNetworkInterfaceByMac(RmNetworkInterface rmNetworkInterface);
/**
* 批量删除客户端网络接口信息
*
* @param ids 需要删除的客户端网络接口信息主键集合
* @return 结果
*/
public int deleteRmNetworkInterfaceByIds(Long[] ids);
/**
* 删除客户端网络接口信息信息
*
* @param id 客户端网络接口信息主键
* @return 结果
*/
public int deleteRmNetworkInterfaceById(Long id);
/**
* 绑定公网ip
* @param rmNetworkInterface
* @return
*/
int bindPublicIp(RmNetworkInterface rmNetworkInterface);
/**
* 更新路由信息
* @param clientId
*/
void updateRouteMsg(String clientId);
}
@@ -1,283 +0,0 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.EchartsDataUtils;
import com.ruoyi.common.core.utils.SpeedUtils;
import com.ruoyi.rocketmq.domain.InitialBandwidthTraffic;
import com.ruoyi.rocketmq.mapper.InitialBandwidthTrafficMapper;
import com.ruoyi.rocketmq.service.IInitialBandwidthTrafficService;
import com.ruoyi.rocketmq.utils.TableRouterUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 初始带宽流量Service业务层处理
*
* @author gyt
* @date 2025-08-20
*/
@Service
@Slf4j
public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTrafficService
{
@Autowired
private InitialBandwidthTrafficMapper initialBandwidthTrafficMapper;
/**
* 查询初始带宽流量
*
* @param id 初始带宽流量主键
* @return 初始带宽流量
*/
@Override
public InitialBandwidthTraffic selectInitialBandwidthTrafficById(Long id)
{
return initialBandwidthTrafficMapper.selectInitialBandwidthTrafficById(id);
}
/**
* 查询初始带宽流量列表
*
* @param initialBandwidthTraffic 初始带宽流量
* @return 初始带宽流量
*/
@Override
public List<InitialBandwidthTraffic> selectInitialBandwidthTrafficList(InitialBandwidthTraffic initialBandwidthTraffic)
{
return initialBandwidthTrafficMapper.selectInitialBandwidthTrafficList(initialBandwidthTraffic);
}
/**
* 新增初始带宽流量
*
* @param initialBandwidthTraffic 初始带宽流量
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertInitialBandwidthTraffic(InitialBandwidthTraffic initialBandwidthTraffic)
{
initialBandwidthTraffic.setCreateTime(DateUtils.getNowDate());
return initialBandwidthTrafficMapper.insertInitialBandwidthTraffic(initialBandwidthTraffic);
}
/**
* 修改初始带宽流量
*
* @param initialBandwidthTraffic 初始带宽流量
* @return 结果
*/
@Override
public int updateInitialBandwidthTraffic(InitialBandwidthTraffic initialBandwidthTraffic)
{
initialBandwidthTraffic.setUpdateTime(DateUtils.getNowDate());
return initialBandwidthTrafficMapper.updateInitialBandwidthTraffic(initialBandwidthTraffic);
}
/**
* 批量删除初始带宽流量
*
* @param ids 需要删除的初始带宽流量主键
* @return 结果
*/
@Override
public int deleteInitialBandwidthTrafficByIds(Long[] ids)
{
return initialBandwidthTrafficMapper.deleteInitialBandwidthTrafficByIds(ids);
}
/**
* 删除初始带宽流量信息
*
* @param id 初始带宽流量主键
* @return 结果
*/
@Override
public int deleteInitialBandwidthTrafficById(Long id)
{
return initialBandwidthTrafficMapper.deleteInitialBandwidthTrafficById(id);
}
/**
* 保存单条数据到对应分表
* @param data 流量数据
*/
@Override
@Transactional
public void save(InitialBandwidthTraffic data) {
if (data.getCreateTime() == null) {
data.setCreateTime(DateUtils.getNowDate());
}
Date date = data.getCreateTime();
LocalDateTime createTime = date.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
data.setTableName(TableRouterUtil.getTableName(createTime));
initialBandwidthTrafficMapper.insert(data);
}
/**
* 保存多条数据到对应分表
* @param initialBandwidthTraffic 流量数据
*/
@Override
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
public void batchInsert(InitialBandwidthTraffic initialBandwidthTraffic) {
if (initialBandwidthTraffic == null) {
return;
}
List<InitialBandwidthTraffic> dataList = initialBandwidthTraffic.getList();
if (dataList.isEmpty()){
return;
}
// 按表名分组批量插入
Map<String, List<InitialBandwidthTraffic>> groupedData = dataList.stream()
.map(data -> {
try {
InitialBandwidthTraffic processed = new InitialBandwidthTraffic();
BeanUtils.copyProperties(data,processed);
if (data.getCreateTime() == null) {
data.setCreateTime(DateUtils.getNowDate());
}
LocalDateTime createTime = data.getCreateTime().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
processed.setTableName(TableRouterUtil.getTableName(createTime));
return processed;
} catch (Exception e){
log.error("数据处理失败",e.getMessage());
return null;
}
}).collect(Collectors.groupingBy(
InitialBandwidthTraffic::getTableName,
LinkedHashMap::new, // 保持插入顺序
Collectors.toList()));
groupedData.forEach((tableName, list) -> {
try {
InitialBandwidthTraffic data = new InitialBandwidthTraffic();
BeanUtils.copyProperties(initialBandwidthTraffic,data);
data.setTableName(tableName);
data.setList(list);
initialBandwidthTrafficMapper.batchInsert(data);
} catch (Exception e) {
log.error("表{}插入失败", tableName, e);
throw new RuntimeException("批量插入失败", e);
}
});
}
/**
* 网络接口基础信息
* @param initialBandwidthTraffic
* @return
*/
@Override
public InitialBandwidthTraffic getNetInterfaceDetailsMsg(InitialBandwidthTraffic initialBandwidthTraffic) {
if (initialBandwidthTraffic.getCreateTime() == null) {
initialBandwidthTraffic.setCreateTime(DateUtils.getNowDate());
}
LocalDateTime createTime = initialBandwidthTraffic.getCreateTime().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
initialBandwidthTraffic.setTableName(TableRouterUtil.getTableName(createTime));
InitialBandwidthTraffic detailsMsg = initialBandwidthTrafficMapper.getNetInterfaceDetailsMsg(initialBandwidthTraffic);
return detailsMsg;
}
/**
* 分表查询需要的信息
* @param initialBandwidthTraffic
* @return
*/
public List<InitialBandwidthTraffic> getListByTableName(InitialBandwidthTraffic initialBandwidthTraffic){
// 获取涉及的表名
Set<String> tableNames = TableRouterUtil.getTableNamesBetween(initialBandwidthTraffic.getStartTime(), initialBandwidthTraffic.getEndTime());
// 并行查询各表
List<InitialBandwidthTraffic> list = tableNames.parallelStream()
.flatMap(tableName -> {
InitialBandwidthTraffic condition = new InitialBandwidthTraffic();
condition.setTableName(tableName);
condition.setStartTime(initialBandwidthTraffic.getStartTime());
condition.setEndTime(initialBandwidthTraffic.getEndTime());
condition.setClientId(initialBandwidthTraffic.getClientId());
condition.setName(initialBandwidthTraffic.getName());
return initialBandwidthTrafficMapper.getNetTrafficList(condition).stream();
})
.collect(Collectors.toList());
return list;
}
/**
* 查询eth0流量信息并封装为多折线ECharts图表数据
* @param initialBandwidthTraffic
* @return
*/
@Override
public Map<String, Object> netInterfaceTrafficEcharts(InitialBandwidthTraffic initialBandwidthTraffic) {
// 流量信息
List<InitialBandwidthTraffic> list = getListByTableName(initialBandwidthTraffic);
try {
String unit = SpeedUtils.calculateUnitWithStringTraffic(list, "inSpeed", "outSpeed");
if(initialBandwidthTraffic.getUnit() != null){
unit = initialBandwidthTraffic.getUnit();
}
BigDecimal divisor = SpeedUtils.getDivisor(unit);
Map<String, Function<InitialBandwidthTraffic, ?>> extractors = new LinkedHashMap<>();
extractors.put("netInSpeedData", info ->
info != null && info.getInSpeed() != null ?
new BigDecimal(info.getInSpeed()).divide(divisor, 2, RoundingMode.HALF_UP) :
0);
extractors.put("netOutSpeedData", info ->
info != null && info.getOutSpeed() != null ?
new BigDecimal(info.getOutSpeed()).divide(divisor, 2, RoundingMode.HALF_UP) :
0);
Map<String, Object> resultMap = EchartsDataUtils.buildEchartsDataAutoPadding(
list, InitialBandwidthTraffic::getCreateTime, extractors,
initialBandwidthTraffic.getStartTime(), initialBandwidthTraffic.getEndTime()
);
resultMap.put("unit", unit);
return resultMap;
} catch (Exception e){
e.printStackTrace();
}
return new HashMap<>();
}
// 安全转换方法(处理可能的NumberFormatException
private Double safeConvertToKB(String byteValue) {
try {
return byteValue == null ? 0.0 : Double.parseDouble(byteValue) / 1024.0;
} catch (NumberFormatException e) {
return 0.0; // 或根据业务需求返回null/抛出异常
}
}
/**
* 查询eth0流量信息丢包数并封装为折线ECharts图表数据
* @param initialBandwidthTraffic
* @return
*/
@Override
public Map<String, Object> netInterfaceDroppedEcharts(InitialBandwidthTraffic initialBandwidthTraffic) {
// 流量信息
List<InitialBandwidthTraffic> list = getListByTableName(initialBandwidthTraffic);
Map<String, Function<InitialBandwidthTraffic, ?>> extractors = new LinkedHashMap<>();
extractors.put("inDroppedData", info -> info.getInDropped());
extractors.put("outDroppedData", info -> info.getOutDropped());
return EchartsDataUtils.buildEchartsDataAutoPadding(
list, InitialBandwidthTraffic::getCreateTime, extractors,
initialBandwidthTraffic.getStartTime(), initialBandwidthTraffic.getEndTime()
);
}
}
@@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/ruoyi-visual-monitor" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>
+15 -15
View File
@@ -25,16 +25,16 @@ create table sys_dept (
-- ----------------------------
-- 初始化-部门表数据
-- ----------------------------
insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(100, 0, '0', '彤然科技', 0, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '彤然', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-- ----------------------------
@@ -68,8 +68,8 @@ create table sys_user (
-- ----------------------------
-- 初始化-用户信息表数据
-- ----------------------------
insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), sysdate(), 'admin', sysdate(), '', null, '管理员');
insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), sysdate(), 'admin', sysdate(), '', null, '测试员');
insert into sys_user values(1, 103, 'admin', '彤然', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), sysdate(), 'admin', sysdate(), '', null, '管理员');
insert into sys_user values(2, 105, 'ry', '彤然', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), sysdate(), 'admin', sysdate(), '', null, '测试员');
-- ----------------------------
@@ -164,7 +164,7 @@ create table sys_menu (
insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', '', 1, 0, 'M', '0', '0', '', 'system', 'admin', sysdate(), '', null, '系统管理目录');
insert into sys_menu values('2', '系统监控', '0', '2', 'monitor', null, '', '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', sysdate(), '', null, '系统监控目录');
insert into sys_menu values('3', '系统工具', '0', '3', 'tool', null, '', '', 1, 0, 'M', '0', '0', '', 'tool', 'admin', sysdate(), '', null, '系统工具目录');
insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', null, '', '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, '若依官网地址');
insert into sys_menu values('4', '彤然官网', '0', '4', 'http://tongran.vip', null, '', '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, '彤然官网地址');
-- 二级菜单
insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', sysdate(), '', null, '用户管理菜单');
insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', sysdate(), '', null, '角色管理菜单');
@@ -635,8 +635,8 @@ create table sys_notice (
-- ----------------------------
-- 初始化-公告信息表数据
-- ----------------------------
insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员');
insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员');
insert into sys_notice values('1', '温馨提醒:2018-07-01 彤然新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员');
insert into sys_notice values('2', '维护通知:2018-07-01 彤然系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员');
-- ----------------------------
+8 -8
View File
@@ -34,14 +34,14 @@ CREATE TABLE `config_info` (
insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema, encrypted_data_key) values
(1,'application-dev.yml','DEFAULT_GROUP','spring:\n autoconfigure:\n exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure\n\n# feign 配置\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n min-request-size: 8192\n response:\n enabled: true\n\n# 暴露监控端点\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n','9928f41dfb10386ad38b3254af5692e0','2020-05-20 12:00:00','2024-08-29 12:14:45','nacos','0:0:0:0:0:0:0:1','','','通用配置','null','null','yaml','',''),
(2,'ruoyi-gateway-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestBody\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','4d329eb08a941a8dd9d26f542c6ac6c5','2020-05-14 14:17:55','2024-09-02 12:13:50','nacos','0:0:0:0:0:0:0:1','','','网关模块','null','null','yaml','',''),
(3,'ruoyi-auth-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: localhost\n port: 6379\n password: \n','a03e7632a0a74520eeb4fbedd6d82d97','2020-11-20 00:00:00','2024-09-02 12:13:58','nacos','0:0:0:0:0:0:0:1','','','认证中心','null','null','yaml','',''),
(4,'ruoyi-monitor-dev.yml','DEFAULT_GROUP','# spring\nspring:\n security:\n user:\n name: ruoyi\n password: 123456\n boot:\n admin:\n ui:\n title: 若依服务状态监控\n','6f122fd2bfb8d45f858e7d6529a9cd44','2020-11-20 00:00:00','2024-08-29 12:15:11','nacos','0:0:0:0:0:0:0:1','','','监控中心','null','null','yaml','',''),
(5,'ruoyi-system-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: ruoyi\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.system\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: RuoYi\n url: https://ruoyi.vip\n','786c7daf4543411fc65c3e48dfb15243','2020-11-20 00:00:00','2024-09-02 12:14:33','nacos','0:0:0:0:0:0:0:1','','','系统模块','null','null','yaml','',''),
(6,'ruoyi-gen-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.gen.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: RuoYi\n url: https://ruoyi.vip\n\n# 代码生成\ngen:\n # 作者\n author: ruoyi\n # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool\n packageName: com.ruoyi.system\n # 自动去除表前缀,默认是false\n autoRemovePre: false\n # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)\n tablePrefix: sys_\n # 是否允许生成文件覆盖到本地(自定义路径),默认不允许\n allowOverwrite: false','43d807aa0a4accbb193b6dc7e38ac8a3','2020-11-20 00:00:00','2024-12-25 08:29:33','nacos','0:0:0:0:0:0:0:1','','','代码生成','null','null','yaml','',''),
(7,'ruoyi-job-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.job.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: RuoYi\n url: https://ruoyi.vip\n','f78483f845777335b9ed4a9f84758848','2020-11-20 00:00:00','2024-09-02 12:14:56','nacos','0:0:0:0:0:0:0:1','','','定时任务','null','null','yaml','',''),
(8,'ruoyi-file-dev.yml','DEFAULT_GROUP','# 本地文件上传 \r\nfile:\r\n domain: http://127.0.0.1:9300\r\n path: D:/ruoyi/uploadPath\r\n prefix: /statics\r\n\r\n# FastDFS配置\r\nfdfs:\r\n domain: http://8.129.231.12\r\n soTimeout: 3000\r\n connectTimeout: 2000\r\n trackerList: 8.129.231.12:22122\r\n\r\n# Minio配置\r\nminio:\r\n url: http://8.129.231.12:9000\r\n accessKey: minioadmin\r\n secretKey: minioadmin\r\n bucketName: test','5382b93f3d8059d6068c0501fdd41195','2020-11-20 00:00:00','2020-12-21 21:01:59',NULL,'0:0:0:0:0:0:0:1','','','文件服务','null','null','yaml',NULL,''),
(9,'sentinel-ruoyi-gateway','DEFAULT_GROUP','[\r\n {\r\n \"resource\": \"ruoyi-auth\",\r\n \"count\": 500,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"ruoyi-system\",\r\n \"count\": 1000,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"ruoyi-gen\",\r\n \"count\": 200,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"ruoyi-job\",\r\n \"count\": 300,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n }\r\n]','9f3a3069261598f74220bc47958ec252','2020-11-20 00:00:00','2020-11-20 00:00:00',NULL,'0:0:0:0:0:0:0:1','','','限流策略','null','null','json',NULL,'');
(2,'tongran-gateway-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: tongran-auth\n uri: lb://tongran-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestBody\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: tongran-gen\n uri: lb://tongran-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: tongran-job\n uri: lb://tongran-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: tongran-system\n uri: lb://tongran-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: tongran-file\n uri: lb://tongran-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','4d329eb08a941a8dd9d26f542c6ac6c5','2020-05-14 14:17:55','2024-09-02 12:13:50','nacos','0:0:0:0:0:0:0:1','','','网关模块','null','null','yaml','',''),
(3,'tongran-auth-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: localhost\n port: 6379\n password: \n','a03e7632a0a74520eeb4fbedd6d82d97','2020-11-20 00:00:00','2024-09-02 12:13:58','nacos','0:0:0:0:0:0:0:1','','','认证中心','null','null','yaml','',''),
(4,'tongran-monitor-dev.yml','DEFAULT_GROUP','# spring\nspring:\n security:\n user:\n name: tongran\n password: 123456\n boot:\n admin:\n ui:\n title: 彤然服务状态监控\n','6f122fd2bfb8d45f858e7d6529a9cd44','2020-11-20 00:00:00','2024-08-29 12:15:11','nacos','0:0:0:0:0:0:0:1','','','监控中心','null','null','yaml','',''),
(5,'tongran-system-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: tongran\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.tongran.system\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: tongran\n url: https://tongran.vip\n','786c7daf4543411fc65c3e48dfb15243','2020-11-20 00:00:00','2024-09-02 12:14:33','nacos','0:0:0:0:0:0:0:1','','','系统模块','null','null','yaml','',''),
(6,'tongran-gen-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.tongran.gen.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: tongran\n url: https://tongran.vip\n\n# 代码生成\ngen:\n # 作者\n author: tongran\n # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool\n packageName: com.tongran.system\n # 自动去除表前缀,默认是false\n autoRemovePre: false\n # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)\n tablePrefix: sys_\n # 是否允许生成文件覆盖到本地(自定义路径),默认不允许\n allowOverwrite: false','43d807aa0a4accbb193b6dc7e38ac8a3','2020-11-20 00:00:00','2024-12-25 08:29:33','nacos','0:0:0:0:0:0:0:1','','','代码生成','null','null','yaml','',''),
(7,'tongran-job-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.tongran.job.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: tongran\n url: https://tongran.vip\n','f78483f845777335b9ed4a9f84758848','2020-11-20 00:00:00','2024-09-02 12:14:56','nacos','0:0:0:0:0:0:0:1','','','定时任务','null','null','yaml','',''),
(8,'tongran-file-dev.yml','DEFAULT_GROUP','# 本地文件上传 \r\nfile:\r\n domain: http://127.0.0.1:9300\r\n path: D:/tongran/uploadPath\r\n prefix: /statics\r\n\r\n# FastDFS配置\r\nfdfs:\r\n domain: http://8.129.231.12\r\n soTimeout: 3000\r\n connectTimeout: 2000\r\n trackerList: 8.129.231.12:22122\r\n\r\n# Minio配置\r\nminio:\r\n url: http://8.129.231.12:9000\r\n accessKey: minioadmin\r\n secretKey: minioadmin\r\n bucketName: test','5382b93f3d8059d6068c0501fdd41195','2020-11-20 00:00:00','2020-12-21 21:01:59',NULL,'0:0:0:0:0:0:0:1','','','文件服务','null','null','yaml',NULL,''),
(9,'sentinel-tongran-gateway','DEFAULT_GROUP','[\r\n {\r\n \"resource\": \"tongran-auth\",\r\n \"count\": 500,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"tongran-system\",\r\n \"count\": 1000,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"tongran-gen\",\r\n \"count\": 200,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"tongran-job\",\r\n \"count\": 300,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n }\r\n]','9f3a3069261598f74220bc47958ec252','2020-11-20 00:00:00','2020-11-20 00:00:00',NULL,'0:0:0:0:0:0:0:1','','','限流策略','null','null','json',NULL,'');
/******************************************/
+5 -5
View File
@@ -2,21 +2,21 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<groupId>com.tongran</groupId>
<artifactId>tongran</artifactId>
<version>3.6.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>ruoyi-api-system</module>
<module>tongran-api-system</module>
</modules>
<artifactId>ruoyi-api</artifactId>
<artifactId>tongran-api</artifactId>
<packaging>pom</packaging>
<description>
ruoyi-api系统接口
tongran-api系统接口
</description>
</project>
@@ -3,24 +3,24 @@
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-api</artifactId>
<groupId>com.tongran</groupId>
<artifactId>tongran-api</artifactId>
<version>3.6.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-api-system</artifactId>
<artifactId>tongran-api-system</artifactId>
<description>
ruoyi-api-system系统接口模块
tongran-api-system系统接口模块
</description>
<dependencies>
<!-- RuoYi Common Core-->
<!-- tongran Common Core-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-core</artifactId>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-core</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
@@ -1,4 +1,4 @@
package com.ruoyi.system.api;
package com.tongran.system.api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
@@ -7,15 +7,15 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysFile;
import com.ruoyi.system.api.factory.RemoteFileFallbackFactory;
import com.tongran.common.core.constant.ServiceNameConstants;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.domain.SysFile;
import com.tongran.system.api.factory.RemoteFileFallbackFactory;
/**
* 文件服务
*
* @author ruoyi
* @author tongran
*/
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteFileService
@@ -1,20 +1,20 @@
package com.ruoyi.system.api;
package com.tongran.system.api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysLogininfor;
import com.ruoyi.system.api.domain.SysOperLog;
import com.ruoyi.system.api.factory.RemoteLogFallbackFactory;
import com.tongran.common.core.constant.SecurityConstants;
import com.tongran.common.core.constant.ServiceNameConstants;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.domain.SysLogininfor;
import com.tongran.system.api.domain.SysOperLog;
import com.tongran.system.api.factory.RemoteLogFallbackFactory;
/**
* 日志服务
*
* @author ruoyi
* @author tongran
*/
@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteLogService
@@ -1,11 +1,11 @@
package com.ruoyi.system.api;
package com.tongran.system.api;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.system.api.domain.*;
import com.ruoyi.system.api.factory.RemoteRevenueConfigFallbackFactory;
import com.tongran.common.core.constant.SecurityConstants;
import com.tongran.common.core.constant.ServiceNameConstants;
import com.tongran.common.core.domain.R;
import com.tongran.common.core.web.page.TableDataInfo;
import com.tongran.system.api.domain.*;
import com.tongran.system.api.factory.RemoteRevenueConfigFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@@ -14,7 +14,7 @@ import java.util.List;
/**
* 用户服务
*
* @author ruoyi
* @author tongran
*/
@FeignClient(contextId = "remoteRevenueConfigService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteRevenueConfigFallbackFactory.class)
public interface RemoteRevenueConfigService
@@ -1,13 +1,13 @@
package com.ruoyi.system.api;
package com.tongran.system.api;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.RmAlarmRecordRemote;
import com.ruoyi.system.api.domain.RmDeployScriptRemote;
import com.ruoyi.system.api.domain.RmMonitorPolicyRemote;
import com.ruoyi.system.api.domain.RmNetworkInterfaceRemote;
import com.ruoyi.system.api.factory.RemoteRocketMqFallbackFactory;
import com.tongran.common.core.constant.SecurityConstants;
import com.tongran.common.core.constant.ServiceNameConstants;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.domain.RmAlarmRecordRemote;
import com.tongran.system.api.domain.RmDeployScriptRemote;
import com.tongran.system.api.domain.RmMonitorPolicyRemote;
import com.tongran.system.api.domain.RmNetworkInterfaceRemote;
import com.tongran.system.api.factory.RemoteRocketMqFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@@ -56,7 +56,7 @@ public interface RemoteRocketMqService {
public R<List<RmNetworkInterfaceRemote>> getNetworkInterfaceList(@RequestBody RmNetworkInterfaceRemote rmNetworkInterfaceRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* 获取网卡接口列表
* 绑定业务网卡
* @param rmNetworkInterfaceRemote
* @param source
* @return
@@ -70,7 +70,7 @@ public interface RemoteRocketMqService {
* @return
*/
@GetMapping("/monitorPolicy/innerIssueSwitchPolicy")
public R<String> innerIssueSwitchPolicy(Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
public R<String> innerIssueSwitchPolicy(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* 查询策略信息
* @param rmMonitorPolicyRemote
@@ -95,7 +95,15 @@ public interface RemoteRocketMqService {
* @return
*/
@GetMapping("/monitorPolicy/issueDefaultPolicyByClientId")
public R<Integer> issueDefaultPolicyByClientId(String clientId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
public R<Integer> issueDefaultPolicyByClientId(@RequestParam("clientId") String clientId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
@PostMapping("policy/addDeployScript")
R<Integer> addDeployScript(@RequestBody RmDeployScriptRemote addData, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* 获取子网卡接口列表
* @param rmNetworkInterfaceRemote
* @param source
* @return
*/
@PostMapping("/networkInterfaceChild/innerGetChildList")
public R<List<RmNetworkInterfaceRemote>> innerGetChildList(@RequestBody RmNetworkInterfaceRemote rmNetworkInterfaceRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
@@ -1,20 +1,20 @@
package com.ruoyi.system.api;
package com.tongran.system.api;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.EpsInitialTrafficDataRemote;
import com.ruoyi.system.api.domain.NodeBandwidth;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;
import com.tongran.common.core.constant.SecurityConstants;
import com.tongran.common.core.constant.ServiceNameConstants;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.domain.EpsInitialTrafficDataRemote;
import com.tongran.system.api.domain.NodeBandwidth;
import com.tongran.system.api.domain.SysUser;
import com.tongran.system.api.factory.RemoteUserFallbackFactory;
import com.tongran.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
/**
* 用户服务
*
* @author ruoyi
* @author tongran
*/
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
@@ -1,7 +1,7 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.util.Set;
@@ -1,7 +1,7 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
/**
@@ -1,7 +1,7 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
@@ -1,8 +1,8 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
@@ -1,7 +1,7 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
@@ -1,8 +1,10 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
@Data
public class NetworkInfo {
// 运营商
@@ -17,6 +19,9 @@ public class NetworkInfo {
// IPv4 地址
@JsonProperty("ipv4")
private String ipv4;
// IPv4 地址
@JsonProperty("ipv6")
private String ipv6;
// MAC 地址
@JsonProperty("mac")
private String mac;
@@ -31,4 +36,11 @@ public class NetworkInfo {
private String publicIp;
@JsonProperty("type")
private String type;
// 如果是子接口存储父接口名称
@JsonProperty("parentInterface")
private String parentInterface;
// 如果是父接口存储子接口列表
@JsonProperty("subInterfaces")
private List<NetworkInfo> subInterfaces;
}
@@ -1,7 +1,7 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -1,8 +1,8 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -1,7 +1,7 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel;
import lombok.Data;
import java.util.Date;
@@ -1,8 +1,8 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
@@ -1,7 +1,7 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
@Data
@@ -44,6 +44,8 @@ public class RmNetworkInterfaceRemote extends BaseEntity {
/** IPv4地址 */
@Excel(name = "IPv4地址")
private String ipv4Address;
/** IPv6地址 */
private String ipv6Address;
/** 网关 */
@Excel(name = "网关")
@@ -52,6 +54,11 @@ public class RmNetworkInterfaceRemote extends BaseEntity {
private String bindIp;
/** 新旧标识 */
private Integer newFlag;
/** 服务器clientId集合 */
/** 查询业务网卡或单个网卡的clientId集合 */
private String clientIds;
/** 查询所有网卡的clientId集合 */
private String allClientIds;
// 如果是子接口存储父接口名称
private String parentInterface;
}
@@ -1,4 +1,4 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -1,8 +1,8 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
@@ -1,8 +1,8 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
@@ -1,6 +1,6 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel;
import lombok.Data;
import java.util.Date;
@@ -1,4 +1,4 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import lombok.Data;
@@ -1,4 +1,4 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import java.util.ArrayList;
import java.util.List;
@@ -8,12 +8,12 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.web.domain.BaseEntity;
/**
* 部门表 sys_dept
*
* @author ruoyi
* @author tongran
*/
public class SysDept extends BaseEntity
{
@@ -1,18 +1,18 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.annotation.Excel.ColumnType;
import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel.ColumnType;
import com.tongran.common.core.constant.UserConstants;
import com.tongran.common.core.web.domain.BaseEntity;
/**
* 字典数据表 sys_dict_data
*
* @author ruoyi
* @author tongran
*/
public class SysDictData extends BaseEntity
{
@@ -1,18 +1,18 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.annotation.Excel.ColumnType;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel.ColumnType;
import com.tongran.common.core.web.domain.BaseEntity;
/**
* 字典类型表 sys_dict_type
*
* @author ruoyi
* @author tongran
*/
public class SysDictType extends BaseEntity
{
@@ -1,4 +1,4 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -6,7 +6,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 文件信息
*
* @author ruoyi
* @author tongran
*/
public class SysFile
{
@@ -1,15 +1,15 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.annotation.Excel.ColumnType;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel.ColumnType;
import com.tongran.common.core.web.domain.BaseEntity;
/**
* 系统访问记录表 sys_logininfor
*
* @author ruoyi
* @author tongran
*/
public class SysLogininfor extends BaseEntity
{
@@ -1,15 +1,15 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.annotation.Excel.ColumnType;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel.ColumnType;
import com.tongran.common.core.web.domain.BaseEntity;
/**
* 操作日志记录表 oper_log
*
* @author ruoyi
* @author tongran
*/
public class SysOperLog extends BaseEntity
{
@@ -1,4 +1,4 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import java.util.Set;
import javax.validation.constraints.NotBlank;
@@ -6,14 +6,14 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.annotation.Excel.ColumnType;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel.ColumnType;
import com.tongran.common.core.web.domain.BaseEntity;
/**
* 角色表 sys_role
*
* @author ruoyi
* @author tongran
*/
public class SysRole extends BaseEntity
{
@@ -1,22 +1,22 @@
package com.ruoyi.system.api.domain;
package com.tongran.system.api.domain;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.annotation.Excel.ColumnType;
import com.ruoyi.common.core.annotation.Excel.Type;
import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.annotation.Excels;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.ruoyi.common.core.xss.Xss;
import com.tongran.common.core.annotation.Excel;
import com.tongran.common.core.annotation.Excel.ColumnType;
import com.tongran.common.core.annotation.Excel.Type;
import com.tongran.common.core.constant.UserConstants;
import com.tongran.common.core.annotation.Excels;
import com.tongran.common.core.web.domain.BaseEntity;
import com.tongran.common.core.xss.Xss;
/**
* 用户对象 sys_user
*
* @author ruoyi
* @author tongran
*/
public class SysUser extends BaseEntity
{
@@ -1,18 +1,18 @@
package com.ruoyi.system.api.factory;
package com.tongran.system.api.factory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteFileService;
import com.ruoyi.system.api.domain.SysFile;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.RemoteFileService;
import com.tongran.system.api.domain.SysFile;
/**
* 文件服务降级处理
*
* @author ruoyi
* @author tongran
*/
@Component
public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService>
@@ -1,18 +1,18 @@
package com.ruoyi.system.api.factory;
package com.tongran.system.api.factory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteLogService;
import com.ruoyi.system.api.domain.SysLogininfor;
import com.ruoyi.system.api.domain.SysOperLog;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.RemoteLogService;
import com.tongran.system.api.domain.SysLogininfor;
import com.tongran.system.api.domain.SysOperLog;
/**
* 日志服务降级处理
*
* @author ruoyi
* @author tongran
*/
@Component
public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService>
@@ -1,9 +1,9 @@
package com.ruoyi.system.api.factory;
package com.tongran.system.api.factory;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.system.api.RemoteRevenueConfigService;
import com.ruoyi.system.api.domain.*;
import com.tongran.common.core.domain.R;
import com.tongran.common.core.web.page.TableDataInfo;
import com.tongran.system.api.RemoteRevenueConfigService;
import com.tongran.system.api.domain.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -14,7 +14,7 @@ import java.util.List;
/**
* 用户服务降级处理
*
* @author ruoyi
* @author tongran
*/
@Component
public class RemoteRevenueConfigFallbackFactory implements FallbackFactory<RemoteRevenueConfigService>
@@ -1,11 +1,11 @@
package com.ruoyi.system.api.factory;
package com.tongran.system.api.factory;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteRocketMqService;
import com.ruoyi.system.api.domain.RmAlarmRecordRemote;
import com.ruoyi.system.api.domain.RmDeployScriptRemote;
import com.ruoyi.system.api.domain.RmMonitorPolicyRemote;
import com.ruoyi.system.api.domain.RmNetworkInterfaceRemote;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.RemoteRocketMqService;
import com.tongran.system.api.domain.RmAlarmRecordRemote;
import com.tongran.system.api.domain.RmDeployScriptRemote;
import com.tongran.system.api.domain.RmMonitorPolicyRemote;
import com.tongran.system.api.domain.RmNetworkInterfaceRemote;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -18,7 +18,7 @@ import java.util.Map;
/**
* 用户服务降级处理
*
* @author ruoyi
* @author tongran
*/
@Component
public class RemoteRocketMqFallbackFactory implements FallbackFactory<RemoteRocketMqService>
@@ -83,6 +83,11 @@ public class RemoteRocketMqFallbackFactory implements FallbackFactory<RemoteRock
public R<Integer> addDeployScript(RmDeployScriptRemote addData, String source) {
return R.fail(throwable.getMessage());
}
@Override
public R<List<RmNetworkInterfaceRemote>> innerGetChildList(RmNetworkInterfaceRemote rmNetworkInterfaceRemote, String source) {
return R.fail(throwable.getMessage());
}
};
}
}
@@ -1,11 +1,11 @@
package com.ruoyi.system.api.factory;
package com.tongran.system.api.factory;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteUserService;
import com.ruoyi.system.api.domain.EpsInitialTrafficDataRemote;
import com.ruoyi.system.api.domain.NodeBandwidth;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import com.tongran.common.core.domain.R;
import com.tongran.system.api.RemoteUserService;
import com.tongran.system.api.domain.EpsInitialTrafficDataRemote;
import com.tongran.system.api.domain.NodeBandwidth;
import com.tongran.system.api.domain.SysUser;
import com.tongran.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
/**
* 用户服务降级处理
*
* @author ruoyi
* @author tongran
*/
@Component
public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserService>
@@ -1,13 +1,13 @@
package com.ruoyi.system.api.model;
package com.tongran.system.api.model;
import java.io.Serializable;
import java.util.Set;
import com.ruoyi.system.api.domain.SysUser;
import com.tongran.system.api.domain.SysUser;
/**
* 用户信息
*
* @author ruoyi
* @author tongran
*/
public class LoginUser implements Serializable
{
@@ -0,0 +1,5 @@
com.tongran.system.api.factory.RemoteUserFallbackFactory
com.tongran.system.api.factory.RemoteLogFallbackFactory
com.tongran.system.api.factory.RemoteFileFallbackFactory
com.tongran.system.api.factory.RemoteRevenueConfigFallbackFactory
com.tongran.system.api.factory.RemoteRocketMqFallbackFactory
+7 -7
View File
@@ -2,16 +2,16 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<groupId>com.tongran</groupId>
<artifactId>tongran</artifactId>
<version>3.6.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-auth</artifactId>
<artifactId>tongran-auth</artifactId>
<description>
ruoyi-auth认证授权中心
tongran-auth认证授权中心
</description>
<dependencies>
@@ -46,10 +46,10 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- RuoYi Common Security-->
<!-- tongran Common Security-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-security</artifactId>
<groupId>com.tongran</groupId>
<artifactId>tongran-common-security</artifactId>
</dependency>
</dependencies>
@@ -1,22 +1,22 @@
package com.ruoyi.auth;
package com.tongran.auth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import com.tongran.common.security.annotation.EnableRyFeignClients;
/**
* 认证授权中心
*
* @author ruoyi
* @author tongran
*/
@EnableRyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
public class RuoYiAuthApplication
public class TongRanAuthApplication
{
public static void main(String[] args)
{
SpringApplication.run(RuoYiAuthApplication.class, args);
SpringApplication.run(TongRanAuthApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 认证授权中心启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
@@ -1,4 +1,4 @@
package com.ruoyi.auth.controller;
package com.tongran.auth.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
@@ -6,21 +6,21 @@ import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.auth.form.LoginBody;
import com.ruoyi.auth.form.RegisterBody;
import com.ruoyi.auth.service.SysLoginService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.JwtUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.security.auth.AuthUtil;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.model.LoginUser;
import com.tongran.auth.form.LoginBody;
import com.tongran.auth.form.RegisterBody;
import com.tongran.auth.service.SysLoginService;
import com.tongran.common.core.domain.R;
import com.tongran.common.core.utils.JwtUtils;
import com.tongran.common.core.utils.StringUtils;
import com.tongran.common.security.auth.AuthUtil;
import com.tongran.common.security.service.TokenService;
import com.tongran.common.security.utils.SecurityUtils;
import com.tongran.system.api.model.LoginUser;
/**
* token 控制
*
* @author ruoyi
* @author tongran
*/
@RestController
public class TokenController
@@ -1,9 +1,9 @@
package com.ruoyi.auth.form;
package com.tongran.auth.form;
/**
* 用户登录对象
*
* @author ruoyi
* @author tongran
*/
public class LoginBody
{
@@ -1,9 +1,9 @@
package com.ruoyi.auth.form;
package com.tongran.auth.form;
/**
* 用户注册对象
*
* @author ruoyi
* @author tongran
*/
public class RegisterBody extends LoginBody
{
@@ -1,28 +1,28 @@
package com.ruoyi.auth.service;
package com.tongran.auth.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.core.constant.CacheConstants;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.enums.UserStatus;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.ip.IpUtils;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.RemoteUserService;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import com.tongran.common.core.constant.CacheConstants;
import com.tongran.common.core.constant.Constants;
import com.tongran.common.core.constant.SecurityConstants;
import com.tongran.common.core.constant.UserConstants;
import com.tongran.common.core.domain.R;
import com.tongran.common.core.enums.UserStatus;
import com.tongran.common.core.exception.ServiceException;
import com.tongran.common.core.text.Convert;
import com.tongran.common.core.utils.DateUtils;
import com.tongran.common.core.utils.StringUtils;
import com.tongran.common.core.utils.ip.IpUtils;
import com.tongran.common.redis.service.RedisService;
import com.tongran.common.security.utils.SecurityUtils;
import com.tongran.system.api.RemoteUserService;
import com.tongran.system.api.domain.SysUser;
import com.tongran.system.api.model.LoginUser;
/**
* 登录校验方法
*
* @author ruoyi
* @author tongran
*/
@Component
public class SysLoginService
@@ -1,19 +1,19 @@
package com.ruoyi.auth.service;
package com.tongran.auth.service;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.core.constant.CacheConstants;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.tongran.common.core.constant.CacheConstants;
import com.tongran.common.core.constant.Constants;
import com.tongran.common.core.exception.ServiceException;
import com.tongran.common.redis.service.RedisService;
import com.tongran.common.security.utils.SecurityUtils;
import com.tongran.system.api.domain.SysUser;
/**
* 登录密码方法
*
* @author ruoyi
* @author tongran
*/
@Component
public class SysPasswordService
@@ -1,18 +1,18 @@
package com.ruoyi.auth.service;
package com.tongran.auth.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.ip.IpUtils;
import com.ruoyi.system.api.RemoteLogService;
import com.ruoyi.system.api.domain.SysLogininfor;
import com.tongran.common.core.constant.Constants;
import com.tongran.common.core.constant.SecurityConstants;
import com.tongran.common.core.utils.StringUtils;
import com.tongran.common.core.utils.ip.IpUtils;
import com.tongran.system.api.RemoteLogService;
import com.tongran.system.api.domain.SysLogininfor;
/**
* 记录日志方法
*
* @author ruoyi
* @author tongran
*/
@Component
public class SysRecordLogService
@@ -6,16 +6,15 @@ server:
spring:
application:
# 应用名称
name: ruoyi-auth
name: tongran-auth
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
server-addr: 172.16.15.52:8848
# 服务注册地址
# server-addr: 172.16.15.103:8848
server-addr: ${spring.cloud.nacos.config.server-addr}
namespace: ${spring.cloud.nacos.config.namespace}
username: ${spring.cloud.nacos.config.username}
password: ${spring.cloud.nacos.config.password}
@@ -23,7 +22,8 @@ spring:
# 配置中心地址
server-addr: 172.16.15.52:8848
# server-addr: 172.16.15.103:8848
namespace: saas-local
# namespace: public
namespace: saas-prod
username: nacos
password: nacos
# 配置文件格式
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/ruoyi-file" />
<property name="log.path" value="logs/tongran-auth" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
@@ -58,7 +58,7 @@
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<logger name="com.tongran" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.tongran</groupId>
<artifactId>tongran</artifactId>
<version>3.6.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>tongran-common-log</module>
<module>tongran-common-core</module>
<module>tongran-common-redis</module>
<module>tongran-common-seata</module>
<module>tongran-common-swagger</module>
<module>tongran-common-security</module>
<module>tongran-common-sensitive</module>
<module>tongran-common-datascope</module>
<module>tongran-common-datasource</module>
</modules>
<artifactId>tongran-common</artifactId>
<packaging>pom</packaging>
<description>
tongran-common通用模块
</description>
</project>
@@ -3,16 +3,16 @@
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<groupId>com.tongran</groupId>
<artifactId>tongran-common</artifactId>
<version>3.6.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-common-core</artifactId>
<artifactId>tongran-common-core</artifactId>
<description>
ruoyi-common-core核心模块
tongran-common-core核心模块
</description>
<dependencies>

Some files were not shown because too many files have changed in this diff Show More