From 520a2ddbaf156063686e29bb8e9cb3e9065ae7f0 Mon Sep 17 00:00:00 2001
From: fengjin <1435304038@qq.com>
Date: 星期一, 14 十一月 2022 17:42:46 +0800
Subject: [PATCH] 1.修改导半工单手机号判重bug 2.修改天气接口

---
 flower_city/src/main/java/com/dg/core/controller/CommonController.java |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/flower_city/src/main/java/com/dg/core/controller/CommonController.java b/flower_city/src/main/java/com/dg/core/controller/CommonController.java
index bb24589..d4fdfa3 100644
--- a/flower_city/src/main/java/com/dg/core/controller/CommonController.java
+++ b/flower_city/src/main/java/com/dg/core/controller/CommonController.java
@@ -17,6 +17,7 @@
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -54,6 +55,9 @@
     private int port;
     @Value("${ftp.url}")
     private String url;
+
+    @Resource
+    RedisTemplate<String, Object> redisTemplate;
 
 
     @RequestMapping("/hello")
@@ -160,11 +164,10 @@
         TestDate td = new TestDate();
         Map weather;
         if (code == null) {
-            weather = td.getWeather("510400");
+            return ResultData.success(redisTemplate.opsForValue().get("weather") + "");
         } else {
-            weather = td.getWeather(code);
+            return ResultData.success(td.getWeather(code));
         }
-        return ResultData.success(weather);
     }
 
 

--
Gitblit v1.7.1