* 获取所欲关注者列表
*
* @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);
}