添加系统健康模块

This commit is contained in:
2026-05-12 16:36:23 +08:00
parent d88eb4ae8d
commit 0a577a1124
6 changed files with 107 additions and 0 deletions

View File

@@ -100,6 +100,11 @@
<artifactId>xtools-app-monitor-client</artifactId> <artifactId>xtools-app-monitor-client</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.xujun</groupId>
<artifactId>xtools-app-monitor-health</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Monitor end --> <!-- Monitor end -->
<!-- Sys 模块 begin --> <!-- Sys 模块 begin -->

View File

@@ -15,6 +15,7 @@
<modules> <modules>
<module>xtools-app-monitor-boot</module> <module>xtools-app-monitor-boot</module>
<module>xtools-app-monitor-client</module> <module>xtools-app-monitor-client</module>
<module>xtools-app-monitor-health</module>
</modules> </modules>
</project> </project>

View File

@@ -0,0 +1,32 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.xujun</groupId>
<artifactId>xtools-app-monitor</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>xtools-app-monitor-health</artifactId>
<!-- 依赖 -->
<dependencies>
<!-- xtools-boot begin -->
<!-- xtools-boot-core -->
<dependency>
<groupId>org.xujun</groupId>
<artifactId>xtools-boot-core</artifactId>
</dependency>
<!-- xtools-boot end -->
<!-- SpringBoot begin -->
<!-- SpringBoot-Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- SpringBoot end -->
</dependencies>
</project>

View File

@@ -0,0 +1,33 @@
package xtools.app.monitor.health.config;
import org.springframework.stereotype.Component;
import xtools.boot.core.interfaces.FilterWhitelist;
import java.util.Set;
/**
* <p>Title : HealthFilterWhitelist</p>
* <p>Description : HealthFilterWhitelist</p>
* <p>DevelopTools : Idea_x64_v2026.1</p>
* <p>DevelopSystem : macOS Sequoia 15.7.5</p>
* <p>Company : org.xujun</p>
*
* @author : XuJun
* @version : 1.0.0
* @date : 2026/5/12 16:26
*/
@Component
public class HealthFilterWhitelist implements FilterWhitelist {
/**
* 添加过滤器白名单
*
* @return 过滤器白名单
*/
@Override
public Set<String> add() {
return Set.of(
"/health"
);
}
}

View File

@@ -0,0 +1,31 @@
package xtools.app.monitor.health.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xtools.boot.api.model.dto.Result;
/**
* <p>Title : HealthController</p>
* <p>Description : HealthController</p>
* <p>DevelopTools : Idea_x64_v2026.1</p>
* <p>DevelopSystem : macOS Sequoia 15.7.5</p>
* <p>Company : org.xujun</p>
*
* @author : XuJun
* @version : 1.0.0
* @date : 2026/5/12 16:23
*/
@RestController
public class HealthController {
/**
* 健康检查
*
* @return ok
*/
@RequestMapping("/health")
public Result<Object> health() {
return Result.ok();
}
}

View File

@@ -30,6 +30,11 @@
<groupId>org.xujun</groupId> <groupId>org.xujun</groupId>
<artifactId>xtools-app-monitor-client</artifactId> <artifactId>xtools-app-monitor-client</artifactId>
</dependency> </dependency>
<!-- xtools-app-monitor-health -->
<dependency>
<groupId>org.xujun</groupId>
<artifactId>xtools-app-monitor-health</artifactId>
</dependency>
<!-- xtools-boot-job-xxl --> <!-- xtools-boot-job-xxl -->
<dependency> <dependency>
<groupId>org.xujun</groupId> <groupId>org.xujun</groupId>