@Test public void testListMpNews() { MpNewsPagination mpNewsPagination = Materials.defaultMaterials().listMpNews(84, 0, 10); Assert.assertNotNull(mpNewsPagination); }
public MpNewsPagination listMpNews(int agentId, int offset, int size) { String request = "{\"type\":\"%s\",\"agentid\":%s,\"offset\":%s,\"count\":%s}"; String url = WxEndpoint.get("url.material.list"); String response = wxClient.post(url, String.format(request, MediaType.mpnews.name(), agentId, offset, size)); logger.debug("list mpnews: {}", response); return JsonMapper.defaultMapper().fromJson(response, MpNewsPagination.class); }
Materials { public MpNewsPagination listMpNews(int agentId, int offset, int size) { String request = "{\"type\":\"%s\",\"agentid\":%s,\"offset\":%s,\"count\":%s}"; String url = WxEndpoint.get("url.material.list"); String response = wxClient.post(url, String.format(request, MediaType.mpnews.name(), agentId, offset, size)); logger.debug("list mpnews: {}", response); return JsonMapper.defaultMapper().fromJson(response, MpNewsPagination.class); } }
Materials { public MpNewsPagination listMpNews(int agentId, int offset, int size) { String request = "{\"type\":\"%s\",\"agentid\":%s,\"offset\":%s,\"count\":%s}"; String url = WxEndpoint.get("url.material.list"); String response = wxClient.post(url, String.format(request, MediaType.mpnews.name(), agentId, offset, size)); logger.debug("list mpnews: {}", response); return JsonMapper.defaultMapper().fromJson(response, MpNewsPagination.class); }  }
Materials { public MpNewsPagination listMpNews(int agentId, int offset, int size) { String request = "{\"type\":\"%s\",\"agentid\":%s,\"offset\":%s,\"count\":%s}"; String url = WxEndpoint.get("url.material.list"); String response = wxClient.post(url, String.format(request, MediaType.mpnews.name(), agentId, offset, size)); logger.debug("list mpnews: {}", response); return JsonMapper.defaultMapper().fromJson(response, MpNewsPagination.class); }  static Materials defaultMaterials(); static Materials with(CorpSetting corpSetting); void setWxClient(WxClient wxClient); String addMpNews(int agent, MpNews mpNews); void updateMpNews(int agent, String mediaId, MpNews mpNews); MpNews getMpNews(int agent, String mediaId); void deleteMpNews(int agentId, String mediaId); String upload(int agent, MediaType type, InputStream inputStream, String fileName); File download(int agent, String mediaId); void delete(int agent, String mediaId); String addMpNewsImage(InputStream inputStream, String fileName); Counts count(int agent); MaterialPagination list(int agentId, MediaType type, int offset, int size); MpNewsPagination listMpNews(int agentId, int offset, int size); }
Materials { public MpNewsPagination listMpNews(int agentId, int offset, int size) { String request = "{\"type\":\"%s\",\"agentid\":%s,\"offset\":%s,\"count\":%s}"; String url = WxEndpoint.get("url.material.list"); String response = wxClient.post(url, String.format(request, MediaType.mpnews.name(), agentId, offset, size)); logger.debug("list mpnews: {}", response); return JsonMapper.defaultMapper().fromJson(response, MpNewsPagination.class); }  static Materials defaultMaterials(); static Materials with(CorpSetting corpSetting); void setWxClient(WxClient wxClient); String addMpNews(int agent, MpNews mpNews); void updateMpNews(int agent, String mediaId, MpNews mpNews); MpNews getMpNews(int agent, String mediaId); void deleteMpNews(int agentId, String mediaId); String upload(int agent, MediaType type, InputStream inputStream, String fileName); File download(int agent, String mediaId); void delete(int agent, String mediaId); String addMpNewsImage(InputStream inputStream, String fileName); Counts count(int agent); MaterialPagination list(int agentId, MediaType type, int offset, int size); MpNewsPagination listMpNews(int agentId, int offset, int size);  }