♻️ Refactoring code. 适配最新版本 微信公众号接口

This commit is contained in:
lbw committed 2022-05-07 22:30:03 +08:00
1 parent 8262b3ed60
commit 5c10519a8e
1 file changed
+3 -1
@@ -205,10 +205,12 @@ public class WxMaterialController {
try {
WxMpService wxMpService = WxMpInitConfigRunner.getMpServices().get(appId);
WxMpMaterialService wxMpMaterialService = wxMpService.getMaterialService();
int count = (int) page.getSize();
int offset = (int) page.getCurrent() * count - count;
if (WxConsts.MaterialType.NEWS.equals(type)) {
return R.ok(wxMpMaterialService.materialNewsBatchGet(offset, count));
WxMpDraftService draftService = wxMpService.getDraftService();
return R.ok(draftService.listDraft(offset, count));
}
else {
return R.ok(wxMpMaterialService.materialFileBatchGet(type, offset, count));