优化代码

This commit is contained in:
Binary Wang 2018-03-03 16:32:10 +08:00
parent fe7a4705b7
commit c887289518

View File

@ -19,12 +19,16 @@ import java.io.File;
*/
public class WxCpJedisConfigStorage implements WxCpConfigStorage {
/* Redis keys here */
/**
* Redis keys here
*/
private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN";
private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME";
private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET";
private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME";
/* Redis clients pool */
/**
* Redis clients pool
*/
private final JedisPool jedisPool;
private volatile String corpId;
private volatile String corpSecret;
@ -196,8 +200,7 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage {
String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY);
if (expiresTimeStr != null) {
Long expiresTime = Long.parseLong(expiresTimeStr);
return expiresTime;
return Long.parseLong(expiresTimeStr);
}
return 0L;