From 723558ffdf567f66562364b67b283ea927639628 Mon Sep 17 00:00:00 2001 From: gk Date: Sun, 20 Feb 2022 10:53:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kdayun/demo/service/DemoService.java | 6 +----- .../demo/service/impl/DemoServiceImpl.java | 18 +++------------- .../main/java/com/kdayun/demo/util/Utils.java | 21 ------------------- 3 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 modules/kdayun-demo/src/main/java/com/kdayun/demo/util/Utils.java diff --git a/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/DemoService.java b/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/DemoService.java index 8e14de5..a1bac40 100644 --- a/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/DemoService.java +++ b/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/DemoService.java @@ -5,10 +5,6 @@ public interface DemoService { /** * 获取百度云的访问AccessToken */ - String getAccessToken(); + String hello(); - /** - * 刷新百度云的访问AccessToken 失效时候使用 - */ - String refreshAccessToken(); } diff --git a/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/impl/DemoServiceImpl.java b/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/impl/DemoServiceImpl.java index ae1580a..cdf739b 100644 --- a/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/impl/DemoServiceImpl.java +++ b/modules/kdayun-demo/src/main/java/com/kdayun/demo/service/impl/DemoServiceImpl.java @@ -1,29 +1,17 @@ package com.kdayun.demo.service.impl; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import com.kdayun.demo.service.DemoService; -import com.kdayun.demo.util.Utils; @Service public class DemoServiceImpl implements DemoService { - public static String baiduAccessToken = ""; @Override - public String getAccessToken() { - if (StringUtils.isNotBlank(baiduAccessToken)) { - return baiduAccessToken; - } else { - baiduAccessToken = Utils.getAccessToken(); - } - return baiduAccessToken; + public String hello() { + + return "hello"; } - @Override - public String refreshAccessToken() { - baiduAccessToken = Utils.getAccessToken(); - return baiduAccessToken; - } } diff --git a/modules/kdayun-demo/src/main/java/com/kdayun/demo/util/Utils.java b/modules/kdayun-demo/src/main/java/com/kdayun/demo/util/Utils.java deleted file mode 100644 index b621c48..0000000 --- a/modules/kdayun-demo/src/main/java/com/kdayun/demo/util/Utils.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.kdayun.demo.util; - -import org.springframework.beans.factory.annotation.Value; - -public class Utils { - - @Value("${demo.appid}") - private String appid; - @Value("${demo.appkey}") - private String appkey; - @Value("${demo.secretkey}") - private String secretkey; - - /** - * 请求获取微信的授权Accesstoken - */ - public static String getAccessToken() { - return ""; - } - -}