add menu support

This commit is contained in:
Daniel Qian
2014-08-21 22:13:13 +08:00
parent 0a3e136605
commit 189f285259
19 changed files with 444 additions and 145 deletions

View File

@ -0,0 +1,67 @@
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;
}
}