Files
weixin-java-tools/src/main/java/chanjarster/weixin/api/WxInMemoryConfigStorage.java
2014-08-22 11:32:03 +08:00

68 lines
1.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package chanjarster.weixin.api;
import chanjarster.weixin.bean.WxAccessToken;
/**
* 基于内存的微信配置provider在实际生产环境中应该将这些配置持久化
* @author chanjarster
*
*/
public class WxInMemoryConfigStorage implements WxConfigStorage {
protected String appId;
protected String secret;
protected String token;
protected String accessToken;
protected int expiresIn;
public void updateAccessToken(WxAccessToken accessToken) {
updateAccessToken(accessToken.getAccess_token(), accessToken.getExpires_in());
}
public void updateAccessToken(String accessToken, int expiresIn) {
this.accessToken = accessToken;
this.expiresIn = expiresIn;
}
public String getAccessToken() {
return this.accessToken;
}
public String getAppId() {
return this.appId;
}
public String getSecret() {
return this.secret;
}
public String getToken() {
return this.token;
}
public int getExpiresIn() {
return this.expiresIn;
}
public void setAppId(String appId) {
this.appId = appId;
}
public void setSecret(String secret) {
this.secret = secret;
}
public void setToken(String token) {
this.token = token;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public void setExpiresIn(int expiresIn) {
this.expiresIn = expiresIn;
}
}