Examples of WxAuth


Examples of org.hamster.weixinmp.dao.entity.auth.WxAuth

  public void setUp() throws WxException, IOException {
    if (StringUtils.isBlank(accessToken)) {
      File testConfigFile = new File(ACCESS_TOKEN_FILE);
      Date currentDate = new Date();
      if (!testConfigFile.exists() || currentDate.getTime() - testConfigFile.lastModified() > 86400000) {
        WxAuth auth = authService.getAccessToken(config.getAppid(), config.getAppsecret());
        this.accessToken = auth.getAccessToken();
        new File(TEST_FOLDER).mkdirs();
        FileWriter writer = new FileWriter(ACCESS_TOKEN_FILE);
        writer.write(accessToken);
        writer.flush();
        writer.close();
View Full Code Here

Examples of org.hamster.weixinmp.dao.entity.auth.WxAuth

    Map<String, String> paramsJson = new HashMap<String, String>();
    paramsJson.put("grant_type", "client_credential");
    paramsJson.put("appid", appid);
    paramsJson.put("secret", appsecret);

    WxAuth result = WxUtil.sendRequest(config.getAccessTokenCreateUrl(),
        HttpMethod.GET, paramsJson, null, WxAuth.class);
    result.setGrantType("client_credential");
    result.setAppid(appid);
    result.setSecret(appsecret);
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.