Package com.belerweb.social.weixin.bean

Examples of com.belerweb.social.weixin.bean.GetFollowersResult


   * 获取所欲关注者列表
   *
   * @param accessToken 调用接口凭证
   */
  public Result<GetFollowersResult> getFollowers(String accessToken) {
    GetFollowersResult result = new GetFollowersResult();
    List<String> openIds = new ArrayList<String>();
    Result<GetFollowersResult> followers = getFollowers(accessToken, null);
    while (followers.success()) {
      for (String openId : followers.getResult().getOpenIds()) {
        openIds.add(openId);
      }
      String nextOpenid = followers.getResult().getNextOpenid();
      if (StringUtils.isBlank(nextOpenid) || followers.getResult().getTotal() == openIds.size()) {
        break;
      }
      followers = getFollowers(accessToken, nextOpenid);
    }
    if (!followers.success()) {
      return new Result<GetFollowersResult>(followers.getError());
    }
    result.setTotal(openIds.size());
    result.setCount(openIds.size());
    result.setOpenIds(openIds);
    return new Result<GetFollowersResult>(result);
  }
View Full Code Here

TOP

Related Classes of com.belerweb.social.weixin.bean.GetFollowersResult

Copyright © 2018 www.massapicom. 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.