MpMessages { private long send(Filter filter, List<String> openIds, String msgType, String message) { String url; Map<String, Object> request = new HashMap<>(); if (openIds != null && !openIds.isEmpty()) { request.put("touser", openIds); url = WxEndpoint.get("url.mass.message.send"); } else { if (filter != null) { request.put("filter", filter); } url = WxEndpoint.get("url.mass.message.sendall"); } request.put("msgtype", msgType); if ("wxcard".equalsIgnoreCase(msgType)) { request.put(msgType, new Card(message)); } else if ("text".equalsIgnoreCase(msgType)) { request.put(msgType, new Text(message)); } else { request.put(msgType, new Media(message)); } String json = JsonMapper.nonEmptyMapper().toJson(request); logger.debug("send message: {}", json); String result = wxClient.post(url, json); Response response = JsonMapper.defaultMapper().fromJson(result, Response.class); return response.getMsgId(); }  static MpMessages defaultMpMessages(); static MpMessages with(AppSetting appSetting); void setWxClient(WxClient wxClient); long mpNews(String mpNews); long mpNews(int group, String mpNews); long mpNews(List<String> openIds, String mpNews); long mpnewsPreview(String wxName, String openId, String mediaId); long text(String text); long text(int group, String text); long text(List<String> openIds, String text); long textPreview(String wxName, String openId, String text); long voice(String voice); long voice(List<String> openIds, String voice); long voice(int group, String voice); long voicePreview(String wxName, String openId, String voice); long image(String image); long image(int group, String image); long image(List<String> openIds, String image); long imagePreview(String wxName, String openId, String image); long video(String mediaId, String title, String desc); long video(int group, String mediaId, String title, String desc); long video(List<String> openIds, String mediaId, String title, String desc); long videoPreview(String wxName, String openId, String mediaId, String title, String desc); long card(String wxcard); long card(int group, String wxcard); long card(List<String> openIds, String wxcard); long cardPreview(String wxName, String openId, String wxcard); void delete(long msgId); boolean success(long msgId);  }
@Test public void testSend(){ List<String> users = new ArrayList<>(); users.add("o7Tmfs3EHCndVenva5knKxA4D3XA"); users.add("o7Tmfs96UDesd920Gzi0jYJPnBzQ"); MpMessages.defaultMpMessages().mpNews(users, "oR82Fct6wNYgjjFMQVNdmi089sdyuSVtovm1DFqG0Wg"); }