mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-29 09:38:19 +08:00
68 lines
1.4 KiB
Java
68 lines
1.4 KiB
Java
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;
|
||
}
|
||
|
||
}
|