From 0ee403fcd9a564093e2fda4cd9ce014bc5723485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Wed, 8 Mar 2023 16:16:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91ActuatorRedisContr?= =?UTF-8?q?oller=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ActuatorRedisController.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/monitor/controller/ActuatorRedisController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/monitor/controller/ActuatorRedisController.java index 9e2ae3fd..5990d2d2 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/monitor/controller/ActuatorRedisController.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/monitor/controller/ActuatorRedisController.java @@ -1,11 +1,11 @@ package com.jero.modules.monitor.controller; import com.alibaba.fastjson.JSONArray; -import lombok.extern.slf4j.Slf4j; import com.jero.common.api.vo.Result; import com.jero.modules.monitor.domain.RedisInfo; +import com.jero.modules.monitor.exception.RedisConnectException; import com.jero.modules.monitor.service.RedisService; -import org.apache.poi.ss.formula.functions.T; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -34,14 +34,14 @@ public class ActuatorRedisController { * @throws Exception */ @GetMapping("/info") - public Result> getRedisInfo() throws Exception { + public Result> getRedisInfo() throws RedisConnectException { List infoList = this.redisService.getRedisInfo(); log.info(infoList.toString()); return Result.OK(infoList); } @GetMapping("/keysSize") - public Map getKeysSize() throws Exception { + public Map getKeysSize() throws RedisConnectException { return redisService.getKeysSize(); } @@ -51,7 +51,7 @@ public class ActuatorRedisController { * @throws Exception */ @GetMapping("/keysSizeForReport") - public Map getKeysSizeReport() throws Exception { + public Map getKeysSizeReport() throws RedisConnectException { return redisService.getMapForReport("1"); } /** @@ -61,7 +61,7 @@ public class ActuatorRedisController { * @throws Exception */ @GetMapping("/memoryForReport") - public Map memoryForReport() throws Exception { + public Map memoryForReport() throws RedisConnectException { return redisService.getMapForReport("2"); } /** @@ -70,12 +70,12 @@ public class ActuatorRedisController { * @throws Exception */ @GetMapping("/infoForReport") - public Map infoForReport() throws Exception { + public Map infoForReport() throws RedisConnectException { return redisService.getMapForReport("3"); } @GetMapping("/memoryInfo") - public Map getMemoryInfo() throws Exception { + public Map getMemoryInfo() throws RedisConnectException { return redisService.getMemoryInfo(); }