feat: 完成数据中心转发网关核心功能(真实联调通过)

核心功能(已连接真实源服务器验证):
- /sys/watchUserLogin 本地处理:RSA解密验证设备密码(防伪造) + 单飞换token + Redis缓存
- 业务接口经本地通配Controller手动HttpUtils透传至源服务器 + 401检测清缓存
- token失效三重自愈:10秒探活 + 预过期刷新 + 被动401兜底

配置隔离(dotenv风格)+ 安全:
- .env 存敏感信息不入库;app.yml 用 ${KEY} 占位符引用;EnvLoader启动前加载
- 移除fastjson(规避0day),JSON改用Solon内置snack4

联调修复多个Solon实际API问题(配置文件名/YAML插件/打包/redisx/注解路径等)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-05 15:32:17 +08:00
co-authored by Claude
parent 159d6362af
commit 020f112124
20 changed files with 1196 additions and 0 deletions
+103
View File
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.renkang</groupId>
<artifactId>dc-solon-gateway</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>dc-solon-gateway</name>
<description>数据中心转发网关:收敛设备token请求,规避HTTP爆破风控误报</description>
<properties>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<solon.version>4.0.4</solon.version>
</properties>
<dependencies>
<!-- Solon Cloud Gateway:提供 Vert.x HTTP Server 与 Solon 内核 -->
<!-- 本项目用本地 Controller + HttpUtils 手动透传,不依赖其路由透传(见 GatewayController -->
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-cloud-gateway</artifactId>
<version>${solon.version}</version>
</dependency>
<!-- Solon YAML 配置支持(默认只读 .properties,需此插件才能读 app.yml -->
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-config-yaml</artifactId>
<version>${solon.version}</version>
</dependency>
<!-- HTTP 客户端:中转手动透传业务接口 + 换token + 探活 -->
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-net-httputils</artifactId>
<version>${solon.version}</version>
</dependency>
<!-- Redis 客户端(redisx,基于 Jedis):token缓存 -->
<dependency>
<groupId>org.noear</groupId>
<artifactId>redisx</artifactId>
<version>1.8.2</version>
</dependency>
<!-- Solon 定时任务:注解 @Scheduled/@EnableScheduling(在 solon-scheduling+ simple 实现 -->
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-scheduling</artifactId>
<version>${solon.version}</version>
</dependency>
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-scheduling-simple</artifactId>
<version>${solon.version}</version>
</dependency>
<!-- JSON 处理:使用 Solon 内置的 snack4org.noear:snack4,由 solon 传递依赖引入),
不再使用 fastjson(规避其历史 0day 漏洞风险) -->
<!-- SLF4J 日志实现:slf4j-simple,提供日志输出(否则 SLF4J 退化为 NOP 无日志) -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.13</version>
</dependency>
</dependencies>
<build>
<finalName>dc-solon-gateway</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- Solon 官方打包插件:打可执行 fat jar(含 Main-Classjava -jar 直接运行) -->
<plugin>
<groupId>org.noear</groupId>
<artifactId>solon-maven-plugin</artifactId>
<version>3.10.5</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>repackage</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>