我需要获取公众号里面所有发表记录里面的文章,我已经掉用了这几个你们接口还是获取不了全部的,我改怎么解决这个问题
private static final String PUBLISH_BATCH_GET_URL = "https://api.weixin.qq.com/cgi-bin/freepublish/batchget";
private static final String DRAFT_BATCH_GET_URL = "https://api.weixin.qq.com/cgi-bin/draft/batchget";
private static final String MATERIAL_BATCH_GET_URL = "https://api.weixin.qq.com/cgi-bin/material/batchget_material";

你好,只能获取5篇文章。没有接口获取发表记录-全部的文章
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.module.ses.api.wechat.WeChatPublishApi;
import cn.iocoder.yudao.module.ses.api.wechat.dto.WeChatDraftBatchGetRespDTO;
import cn.iocoder.yudao.module.ses.api.wechat.dto.WeChatFreePublishBatchGetReqDTO;
import cn.iocoder.yudao.module.ses.api.wechat.dto.WeChatFreePublishBatchGetRespDTO;
import cn.iocoder.yudao.module.ses.api.wechat.dto.WeChatMaterialBatchGetReqDTO;
import cn.iocoder.yudao.module.ses.api.wechat.dto.WeChatMaterialBatchGetRespDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* 微信发布 API 实现类
*/
@Service
@Slf4j
public class WeChatPublishApiImpl implements WeChatPublishApi {
private static final String PUBLISH_BATCH_GET_URL = "https://api.weixin.qq.com/cgi-bin/freepublish/batchget";
private static final String DRAFT_BATCH_GET_URL = "https://api.weixin.qq.com/cgi-bin/draft/batchget";
private static final String MATERIAL_BATCH_GET_URL = "https://api.weixin.qq.com/cgi-bin/material/batchget_material";
@Override
public WeChatFreePublishBatchGetRespDTO getPublishedArticles(String accessToken, WeChatFreePublishBatchGetReqDTO reqDTO) {
String url = PUBLISH_BATCH_GET_URL + "?access_token=" + accessToken;
String safeUrl = PUBLISH_BATCH_GET_URL + "?access_token=" + maskToken(accessToken);
log.info("开始调用微信接口获取已发布消息列表, url: {}, req: {}", safeUrl, reqDTO);
try {
String jsonBody = JSONUtil.toJsonStr(reqDTO);
long startMs = System.currentTimeMillis();
String result = HttpUtil.post(url, jsonBody);
log.info("微信已发布接口返回结果(耗时 {} ms): {}", System.currentTimeMillis() - startMs, result);
WeChatFreePublishBatchGetRespDTO respDTO = JSONUtil.toBean(result, WeChatFreePublishBatchGetRespDTO.class);
if (respDTO.getErrcode() != null && respDTO.getErrcode() != 0) {
log.error("获取已发布消息列表失败, errcode: {}, errmsg: {}", respDTO.getErrcode(), respDTO.getErrmsg());
}
return respDTO;
} catch (Exception e) {
log.error("调用微信接口异常", e);
throw new RuntimeException("调用微信接口异常", e);
}
}
@Override
public WeChatDraftBatchGetRespDTO getDrafts(String accessToken, WeChatFreePublishBatchGetReqDTO reqDTO) {
String url = DRAFT_BATCH_GET_URL + "?access_token=" + accessToken;
String safeUrl = DRAFT_BATCH_GET_URL + "?access_token=" + maskToken(accessToken);
log.info("开始调用微信接口获取草稿列表, url: {}, req: {}", safeUrl, reqDTO);
try {
String jsonBody = JSONUtil.toJsonStr(reqDTO);
long startMs = System.currentTimeMillis();
String result = HttpUtil.post(url, jsonBody);
log.info("微信草稿接口返回结果(耗时 {} ms): {}", System.currentTimeMillis() - startMs, result);
WeChatDraftBatchGetRespDTO respDTO = JSONUtil.toBean(result, WeChatDraftBatchGetRespDTO.class);
if (respDTO.getErrcode() != null && respDTO.getErrcode() != 0) {
log.error("获取草稿列表失败, errcode: {}, errmsg: {}", respDTO.getErrcode(), respDTO.getErrmsg());
}
return respDTO;
} catch (Exception e) {
log.error("调用微信接口异常", e);
throw new RuntimeException("调用微信接口异常", e);
}
}
@Override
public WeChatMaterialBatchGetRespDTO getMaterials(String accessToken, WeChatMaterialBatchGetReqDTO reqDTO) {
String url = MATERIAL_BATCH_GET_URL + "?access_token=" + accessToken;
String safeUrl = MATERIAL_BATCH_GET_URL + "?access_token=" + maskToken(accessToken);
log.info("开始调用微信接口获取素材列表, url: {}, req: {}", safeUrl, reqDTO);
try {
String jsonBody = JSONUtil.toJsonStr(reqDTO);
long startMs = System.currentTimeMillis();
String result = HttpUtil.post(url, jsonBody);
log.info("微信素材接口返回结果(耗时 {} ms): {}", System.currentTimeMillis() - startMs, result);
WeChatMaterialBatchGetRespDTO respDTO = JSONUtil.toBean(result, WeChatMaterialBatchGetRespDTO.class);
if (respDTO.getErrcode() != null && respDTO.getErrcode() != 0) {
log.error("获取素材列表失败, errcode: {}, errmsg: {}", respDTO.getErrcode(), respDTO.getErrmsg());
}
return respDTO;
} catch (Exception e) {
log.error("调用微信接口异常", e);
throw new RuntimeException("调用微信接口异常", e);
}
}
private static String maskToken(String token) {
if (token == null || token.isBlank()) {
return "null";
}
if (token.length() <= 12) {
return token.charAt(0) + "****" + token.charAt(token.length() - 1);
}
return token.substring(0, 6) + "****" + token.substring(token.length() - 4);
}
}
接口返回是正确的,有几条文章,但是拿不到所有文章,最近调用在今天上午10点半左右 公众号id gh_a546a6f830b7