From b92c77d64a3e3deac1eb5a73498a31fd3073b783 Mon Sep 17 00:00:00 2001 From: "kuang.yifei@iwhalecloud.com" Date: Wed, 20 Jul 2022 14:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BE=E5=BA=A6=E5=9C=B0=E5=9B=BEapi?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=BB=8F=E7=BA=AC=E5=BA=A6=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9C=B0=E7=90=86=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ghy/web/controller/tool/BaiduController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java b/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java index 11aea73f..6952d6cb 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java @@ -1,14 +1,17 @@ package com.ghy.web.controller.tool; +import com.alibaba.fastjson.JSONObject; import com.ghy.common.config.BaiduConfig; import com.ghy.common.core.controller.BaseController; import com.ghy.common.core.domain.AjaxResult; import com.ghy.common.utils.ExceptionUtil; import com.ghy.common.utils.http.HttpUtils; +import com.google.gson.JsonObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -21,8 +24,9 @@ public class BaiduController extends BaseController { @PostMapping("/getLocation") @ResponseBody - public AjaxResult getLocationByLot(String location){ + public AjaxResult getLocationByLot(@RequestBody JSONObject jsonObject){ try { + String location = jsonObject.getString("location"); String url = baiduConfig.getUrl().replace("#AK#", baiduConfig.getAk()) + location; String result = HttpUtils.sendGet(url); return AjaxResult.success(result);