|
@@ -43,11 +43,11 @@ public class JiliangUniversityServer {
|
|
|
private String canPassUrl;
|
|
|
|
|
|
/**
|
|
|
- * 请求密钥有效时间为 一天
|
|
|
+ * 请求密钥有效时间为 一天 12H
|
|
|
*
|
|
|
* @see <a href="https://www.hutool.cn/docs/#/cache/TimedCache">定时缓存</a>
|
|
|
*/
|
|
|
- private static TimedCache<String, String> tokenCache = CacheUtil.newTimedCache(24 * 60 * 60 * 1000);
|
|
|
+ private static TimedCache<String, String> tokenCache = CacheUtil.newTimedCache(12 * 60 * 60 * 1000);
|
|
|
|
|
|
/**
|
|
|
* 获取accesskey(有效期一天)
|
|
@@ -65,11 +65,11 @@ public class JiliangUniversityServer {
|
|
|
HealthResultVO resultVO = null;
|
|
|
try {
|
|
|
String body = HttpUtil.post(getTokenUrl, paramMap);
|
|
|
+ log.info("计量大学开放平台获取token响应内容:{}", body);
|
|
|
resultVO = JSON.parseObject(body, HealthResultVO.class);
|
|
|
if (resultVO.getCode().equals(Integer.valueOf(RestCode.SUCCESS.getCode()))) {
|
|
|
tokenCache.put(TOKEN, resultVO.getData().toString());
|
|
|
}
|
|
|
- log.info("计量大学开放平台获取token响应内容:{}", body);
|
|
|
}catch (Exception e){
|
|
|
throw new ServiceException("学校开放接口服务异常,请联系工作人员");
|
|
|
}
|
|
@@ -88,6 +88,7 @@ public class JiliangUniversityServer {
|
|
|
HealthResultVO<JiliangCanPassVO> resultVO = null;
|
|
|
try {
|
|
|
String body = HttpUtil.createPost(canPassUrl).addHeaders(headers).body(JSON.toJSONString(new JiliangCanPassDTO().setData(dto))).execute().body();
|
|
|
+ log.info("计量大学开放平台获取通过结果响应内容:{}", body);
|
|
|
resultVO = JSON.parseObject(body, HealthResultVO.class);
|
|
|
if (resultVO.getCode().equals(Integer.valueOf(RestCode.SUCCESS.getCode()))) {
|
|
|
resultVO.setData(JSON.parseObject(JSON.toJSONString(resultVO.getData()), JiliangCanPassVO.class));
|