public MpNews getMpNews(int agent, String mediaId) { String url = WxEndpoint.get("url.material.mpnews.get"); String response = wxClient.get(String.format(url, agent, mediaId)); GetMpNewsResponse getMpNewsResponse = JsonMapper.defaultMapper().fromJson(response, GetMpNewsResponse.class); if (getMpNewsResponse != null) { return getMpNewsResponse.getMpNews(); } else { return null; } }
public Counts count(int agent) { String response = wxClient.get(String.format(WxEndpoint.get("url.material.count"), agent)); return JsonMapper.defaultMapper().fromJson(response, Counts.class); }
public void delete(int agent, String mediaId) { String response = wxClient.get(String.format(WxEndpoint.get("url.material.delete"), agent, mediaId)); logger.info("material delete result: {}", response); }