AI分析中心服务 健康检查

This commit is contained in:
lxu75
2024-12-25 15:25:44 +08:00
parent 51ef94a6f8
commit bb36ee422f
2 changed files with 13 additions and 13 deletions

View File

@@ -1,26 +1,23 @@
package com.volvo.ai.analytic.center.controller;
import com.volvo.common.core.util.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
@Api(value = "健康检查", tags = "健康检查")
@RestController
public class HealthController {
public class HealthController implements HealthIndicator {
@GetMapping(value = "/actuator/health")
@ApiOperation(value = "健康检查")
public ResultMsg<Boolean> healthCheck(HttpServletResponse response) {
return ResultMsg.ok(true);
@Override
public Health getHealth(boolean includeDetails) {
return HealthIndicator.super.getHealth(includeDetails);
}
@GetMapping(value = "/health/check/test")
@ApiOperation(value = "健康检查测试")
public ResultMsg<Boolean> healthCheckTest(HttpServletResponse response) {
return ResultMsg.ok(true);
@Override
public Health health() {
return Health.up().build();
}
}