From 416dfd0b601b6539ff1cc62dbdfa36d08f0e19d8 Mon Sep 17 00:00:00 2001 From: yuemian Date: Mon, 14 Oct 2024 17:29:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bocloud/cms/booter/controller/ApiController.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bocloud.cms.booter/src/main/java/com/bocloud/cms/booter/controller/ApiController.java b/bocloud.cms.booter/src/main/java/com/bocloud/cms/booter/controller/ApiController.java index d7f9880..59799b8 100644 --- a/bocloud.cms.booter/src/main/java/com/bocloud/cms/booter/controller/ApiController.java +++ b/bocloud.cms.booter/src/main/java/com/bocloud/cms/booter/controller/ApiController.java @@ -10,7 +10,6 @@ import jakarta.servlet.http.HttpServletRequest; import lombok.AllArgsConstructor; import lombok.Data; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; @@ -32,15 +31,12 @@ public class ApiController { @GetMapping("/top") @Operation(summary = "查询TOP") - public List top(@RequestParam(value = "type", required = false) String type, + public List top(@RequestParam(value = "type") String type, @RequestParam(value = "vendorId", required = false) Long vendorId, @RequestParam(value = "vendorType", required = false) String vendorType, @RequestParam(value = "limit", required = false, defaultValue = "5") Integer limit, @Value(Common.REQ_CONTEXT) RequestContext context, HttpServletRequest request) { - if (StringUtils.isEmpty(type)) { - throw new IllegalArgumentException("type is null!"); - } LineChartResult chart = switch (type) { case "hostCpu" -> this.topService.topOfHostCpu(vendorId, limit); case "hostMem" -> this.topService.topOfHostMem(vendorId, limit);