删除冗余文件

master
gk 2022-02-20 10:53:57 +08:00
parent de8473b698
commit 723558ffdf
3 changed files with 4 additions and 41 deletions

View File

@ -5,10 +5,6 @@ public interface DemoService {
/** /**
* 访AccessToken * 访AccessToken
*/ */
String getAccessToken(); String hello();
/**
* 访AccessToken 使
*/
String refreshAccessToken();
} }

View File

@ -1,29 +1,17 @@
package com.kdayun.demo.service.impl; package com.kdayun.demo.service.impl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.kdayun.demo.service.DemoService; import com.kdayun.demo.service.DemoService;
import com.kdayun.demo.util.Utils;
@Service @Service
public class DemoServiceImpl implements DemoService { public class DemoServiceImpl implements DemoService {
public static String baiduAccessToken = "";
@Override @Override
public String getAccessToken() { public String hello() {
if (StringUtils.isNotBlank(baiduAccessToken)) {
return baiduAccessToken; return "hello";
} else {
baiduAccessToken = Utils.getAccessToken();
}
return baiduAccessToken;
} }
@Override
public String refreshAccessToken() {
baiduAccessToken = Utils.getAccessToken();
return baiduAccessToken;
}
} }

View File

@ -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 "";
}
}