AI分析中心服务 健康检查
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user