From 377f2f7180bd9a4decf09dcf735ffd8875107240 Mon Sep 17 00:00:00 2001 From: yanghb <yanghb> Date: 星期二, 04 四月 2023 14:17:38 +0800 Subject: [PATCH] 名称调整 --- DispatchTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DispatchTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java b/DispatchTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java index 533a93d..c4ff6fc 100644 --- a/DispatchTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java +++ b/DispatchTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java @@ -22,6 +22,7 @@ @Autowired private RestTemplate internalRestTemplate; + private final String host = "http://ZUUL-GATEWAY/"; /** * 向redis中存储字符串没有过期时间 @@ -39,7 +40,7 @@ params.add("key", key); params.add("value", value); HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); - String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/setValue_", requestEntity, String.class); + String s = internalRestTemplate.postForObject(host + "/redis/setValue_", requestEntity, String.class); JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); if(jsonObject.getIntValue("code") != 200){ System.err.println("调用redis出错了"); @@ -67,7 +68,7 @@ params.add("value", value); params.add("time", String.valueOf(time)); HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(params, headers); - String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/setValue", requestEntity, String.class); + String s = internalRestTemplate.postForObject(host+"/redis/setValue", requestEntity, String.class); JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); if(jsonObject.getIntValue("code") != 200){ System.err.println("调用redis出错了"); @@ -90,7 +91,7 @@ MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); params.add("key", key); HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); - String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/getValue",requestEntity , String.class); + String s = internalRestTemplate.postForObject(host + "/redis/getValue",requestEntity , String.class); JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); if(jsonObject.getIntValue("code") != 200){ System.err.println("调用redis出错了"); @@ -114,7 +115,7 @@ MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); params.add("key", key); HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); - String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/remove",requestEntity , String.class); + String s = internalRestTemplate.postForObject(host + "/redis/remove",requestEntity , String.class); JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); if(jsonObject.getIntValue("code") != 200){ System.err.println("调用redis出错了"); -- Gitblit v1.7.1