All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.chanjar.weixin.api.WxInMemoryConfigStorage Maven / Gradle / Ivy

package me.chanjar.weixin.api;

import me.chanjar.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;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy