From 3b8adef8ecf33aeba785fd72d3224d60ade06bd4 Mon Sep 17 00:00:00 2001 From: Ziin Date: Fri, 13 Jun 2025 17:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=94=E5=9B=9E=E5=9B=BD?= =?UTF-8?q?=E5=AE=B6=E4=BF=A1=E6=81=AF=E7=9A=84=E6=95=B0=E6=8D=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springbootinit/controller/HostInfoController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/yupi/springbootinit/controller/HostInfoController.java b/src/main/java/com/yupi/springbootinit/controller/HostInfoController.java index 456c403..3f88561 100644 --- a/src/main/java/com/yupi/springbootinit/controller/HostInfoController.java +++ b/src/main/java/com/yupi/springbootinit/controller/HostInfoController.java @@ -14,6 +14,7 @@ import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /* @@ -39,9 +40,13 @@ public class HostInfoController { } @GetMapping("country_info") - public BaseResponse> getCountryInfo(@RequestParam(name = "countryName") String countryName){ - - return ResultUtils.success(hostInfoService.getCountryInfo(countryName)); + public BaseResponse> getCountryInfo(@RequestParam(name = "countryName") String countryName){ + List countryInfo = hostInfoService.getCountryInfo(countryName); + ListcountryNameList = new ArrayList<>(); + for (CountryInfoVO countryInfoVO : countryInfo) { + countryNameList.add(countryInfoVO.getCountryName()); + } + return ResultUtils.success(countryNameList); } @PostMapping("query_count")