diff --git a/src/main/java/com/keyware/htey/config/HertzServerConfig.java b/src/main/java/com/keyware/htey/config/HertzServerConfig.java index 90aeecd..8e42448 100644 --- a/src/main/java/com/keyware/htey/config/HertzServerConfig.java +++ b/src/main/java/com/keyware/htey/config/HertzServerConfig.java @@ -3,7 +3,9 @@ package com.keyware.htey.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; /** * 监控三方服务配置 @@ -12,6 +14,10 @@ import org.springframework.context.annotation.Configuration; @Configuration @ConfigurationProperties(prefix = "hertz") public class HertzServerConfig { + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } /** * 服务地址 */ diff --git a/src/main/java/com/keyware/htey/controller/hertz/HertzController.java b/src/main/java/com/keyware/htey/controller/hertz/HertzController.java index 8e5113c..e591c13 100644 --- a/src/main/java/com/keyware/htey/controller/hertz/HertzController.java +++ b/src/main/java/com/keyware/htey/controller/hertz/HertzController.java @@ -30,8 +30,6 @@ public class HertzController { @ApiResponse(responseCode = "200", description = "系统监视") public Object selectAll() throws IOException { Map monitorData = hertzBeatClient.getMonitorData(); - // 将 JSON 字符串转换为 Map - System.out.println("1"); return monitorData; } }