|
@@ -0,0 +1,23 @@
|
|
|
|
|
+package com.nuojing.admin.controller;
|
|
|
|
|
+
|
|
|
|
|
+import com.nuojing.admin.common.ApiResponse;
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.LinkedHashMap;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 健康检查接口,供负载均衡(SLB)HTTP 健康检查使用
|
|
|
|
|
+ */
|
|
|
|
|
+@RestController
|
|
|
|
|
+public class HealthController {
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/health")
|
|
|
|
|
+ public ApiResponse<Map<String, Object>> health() {
|
|
|
|
|
+ Map<String, Object> data = new LinkedHashMap<>();
|
|
|
|
|
+ data.put("status", "UP");
|
|
|
|
|
+ data.put("timestamp", System.currentTimeMillis());
|
|
|
|
|
+ return ApiResponse.ok(data);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|