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

View File

@@ -6,6 +6,9 @@ management:
web: web:
exposure: exposure:
include: health include: health
base-path: /actuator
path-mapping:
health: health
endpoint: endpoint:
health: health:
show-details: always show-details: always